I have the following service in my AngularJS app, but I am getting error
Uncaught SyntaxError: Unexpected identifier
Error: [$injector:unpr] Unknown provider: NewContactDataProvider <- NewContactData
my NewContactData code:
myApp.factory('NewContactData', function($http,$log, $q) {
return {
saveContact: function(contact){
}
getContacts: function(){
}
};
});
Can someone please point to me what I am doing wrong in it? I just defined a new function getContacts that's all.
Thanks
asked Mar 12, 2014 at 15:23
MChan
7,25227 gold badges86 silver badges137 bronze badges
1 Answer 1
There's a missing comma in your code :) try:
myApp.factory('NewContactData', function($http,$log, $q) {
return {
saveContact: function(contact){
},
getContacts: function(){
}
};
});
answered Mar 12, 2014 at 15:28
Pascal Precht
8,9037 gold badges43 silver badges55 bronze badges
Sign up to request clarification or add additional context in comments.
1 Comment
MChan
@c0bra it takes 7 mins for anyone asking a question to get it accepted, this is SO rules, you might want to check them out :)
default