Hi,

I'm working on the login of my AngularJS app and currently I have the 
service going off loading a list of users from a JSON file, looping through 
the returned JSON and seeing if the passed username and passwords exist in 
the JSON file. If they do then the service should broadcast an event 
telling the UI to change and relocate the user to the main page.

I was wondering if this is the best way to do this or should I just use the 
service to do one thing e.g. get me data. Then let the controller do the 
hard work, e.g. check for the matching username and password, relocate the 
user based on the results of these checks.

Should services be dumb one job only objects and controllers the worker 
objects, or should services do the work and controllers just call functions 
within controllers based on interaction from the ui e.g. click handlers?

Stephen

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to