Let's get started
angular.module('app', [
'ngCookies',
'ngResource',
'ngSanitize',
'ngRoute'
])
This is my simple factory. Nothing fancy here
angular.module('app')
.factory('myFactory', function () {
// Service logic
// ...
// Public API here
return {
isSaved: true
};
});
Here is a controller that utilizes the service. There's another one similar to this. They both follow the same structure
angular.module('app')
.controller('AdvertisersCtrl', [ '$scope', '$location', 'myFactory', function ($scope, $location, myFactory) {
$scope.$emit('controllerChange', 2);
$scope.isFormSave = function () {
// Form Validation
myFactory.isSaved = true;
$location.path('/saved');
};
}]);
Lastly, the error I'm encountering
Error: [$injector:unpr] Unknown provider: myFactoryProvider <- myFactory
http://docs.angularjs.org/error/$injector/unpr?p0=myFactoryProvider
This project was scaffolded using yeoman and includes ngmin among other grunt tasks provided by yeoman.
Thank you all!