I set up a factory in Angular, but I'm encountering the following error message:
Unknown provider:
This is how the factory looks:
app.factory("getFoo", function($scope){
return {
getCommi: function(val,id){
var array = ["hello","world"];
return array;
}
}
});
And here is the controller:
app.controller('myCtrl', ['$scope','getFoo',function($scope,getFoo){
$scope.myArr = getFoo.getCommi(4,1);
}])
I don't understand what's causing this issue. Can you help me identify and fix it?