Situation:- I have a factory named testFactory. Up until now, I was defining my controller like this:
app.controller('testCtrl',function($scope,testFactory)
{
testFactory.Method1(){ //working fine}
}
However, before minimizing the file, I defined the controller as:
app.controller('testCtrl',['$scope','testFactory', function(a,testFactory)
{
testFactory.Method1() {//throws undefined error}
}
I attempted this approach:
app.controller('testCtrl',['$scope','$rootScope','testFactory', function(a,$rootScope,testFactory)
{
testFactory.Method1() {//still thows error- unable to resolve dependency}
}
Now, how should I include my factory in this scenario?