reworked to Ionic 1.0.0 beta