Pham Minh Tan
Pham Minh Tan

Reputation: 2096

ReferenceError: $ionicUser is not defined when use ionic-push

I want to test ionic-push, so I followed this tutorial.

But, when I add a button and add code to DashCtrl. After that, re-run ionic-serve --lab. Click button it make error like this:

enter image description here

How can I fix it?

Upvotes: 1

Views: 333

Answers (1)

InfinitePrime
InfinitePrime

Reputation: 1776

Inject the $ionicUser service into your controller like this:

.controller('DashCtrl', function($scope, $rootScope, $ionicUser, $ionicPush) {
})

If this does not work, then update your ionic CLI tool and try again. There is no need to manually include .js file.

Upvotes: 1

Related Questions