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

asked Mar 12, 2014 at 15:23

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(){
 } 
 }; 
}); 
answered Mar 12, 2014 at 15:28
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

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.