I am new to Angular JS. Here is my issue. I am trying to create a factory . But when I am calling factory it gives me an error -Error undefined is not an object (evaluating: myService.getProjects)
Code:
myApp.factory('myService', function() {
return {
getProjects: function() {
return "Test";
}
};
});
myApp.controller('homeController',['$scope',function($scope,myService)
{
$scope.projects=myService.getProjects();
$scope.message="homeController";
}]);