In the following code i get a type error as
Type error:Cannot read property 'GET()' of undefined what ami doing wrong here
Services
MyApp.factory('Myops', function($resource) {
return $resource('/projects/:ID/releases/', {
ID: "@ID"
}, {
"update": {
method: "PUT"
},
"create": {
method: "POST"
},
"get": {
method: "GET"
}
});
});
Controller
MyApp.controller("psCtrls", ['$scope', 'Myops', function($scope, Myops) {
myops = Myops.GET()
console.log(myops);
}]);
update 1:
After the inclusion of My ops this is the error
Error:[$injector:unpr ] Unknown provider :$resource provider<-$resource<-Myops