1

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

1 Answer 1

1

There's a missing comma in your code :) try:

myApp.factory('NewContactData', function($http,$log, $q) {
 return {    
   saveContact: function(contact){
   }, 
   getContacts: function(){

   }      
 }; 
}); 
Sign up to request clarification or add additional context in comments.

1 Comment

@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 :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.