FlavorScape
FlavorScape

Reputation: 14299

what is this angular error?

Just made a simple controller with some injection.

var SimpleProductListController = BaseController.extend({

    _notifications:null,
    _productsModel:null,

    init:function($scope,ProductsModel,$route){
    },    
    defineListeners:function(){
        this._super();            
    },
    destroy:function(){

    }
})
/...

SimpleProductListController.$inject = ['$scope','ProductsModel','$route'];

The console error points to this: http://errors.angularjs.org/1.2.16/ng/areq?p0=SimpleProductListController&p1=not%20aNaNunction%2C%20got%20undefined

Argument 'SimpleProductListController' is not aNaNunction, got undefined

How am I supposed to even debug this? I got batarang but it does nothing here.

Upvotes: 2

Views: 2622

Answers (1)

Garrett McCullough
Garrett McCullough

Reputation: 980

Basically, Angular is saying that SimpleProductListController is undefined.

When I've gotten that error, it was because I created a controller and tried to inject it into my app but I did not load the file that defines that controller by adding the script tag to my index.html file.

Upvotes: 5

Related Questions