Inject Ionic push in other controllers


#1

According to the doc http://docs.ionic.io/v2.0.0-beta/docs/push-full-setup#section-3-5-add-some-push-code

I have to register my device token in run()

.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
var push = new Ionic.Push({
“debug”: true
});

push.register(function(token) {
  console.log("Device token:",token.token);
  push.saveToken(token);  // persist the token in the Ionic Platform
});

});
})

But can use new Ionic somewhere else? means in my other controller? I tried to inject but failed. Why the official doc is poorly written. :frowning: