thanks, this was helpful to me I have put together a demo app which is showing the use of most angular concepts https://github.com/oviwankenobi/AngularJSTodoList#angularjstodolist
On Friday, 17 August 2012 20:00:53 UTC+2, Ben Clinkinbeard wrote: > > In order to get this straight in my own head I have created a very simple > demo which can be viewed at http://jsbin.com/ohamub/1/edit > > There are comments in the code illustrating the primary differences but I > will expand on them a bit here. As a note, I am just getting my head around > this so if I say anything that is wrong please let me know. > > *Services* > Syntax: module.service( 'serviceName', function ); > Result: When declaring serviceName as an injectable argument *you will be > provided the actual function reference* passed to module.service. > Usage: Could be useful for sharing utility functions that are useful to > invoke by simply appending () to the injected function reference. Could > also be run with injectedArg.call( this ) or similar. > > *Factories* > Syntax: module.factory( 'factoryName', function ); > Result: When declaring factoryName as an injectable argument *you will be > provided the value that is returned by invoking the function reference* > passed to module.factory. > Usage: Could be useful for returning a 'class' function that can then be > new'ed to create instances. > > *Providers* > Syntax: module.provider( 'providerName', function ); > Result: When declaring providerName as an injectable argument *you will > be provided the value that is returned by invoking the $get method of the > function reference* passed to module.provider. > Usage: Could be useful for returning a 'class' function that can then be > new'ed to create instances but that requires some sort of configuration > before being injected. Perhaps useful for classes that are reusable across > projects? Still kind of hazy on this one. > > Again, please let me know if I have misspoken here, but hopefully this is > accurate and will prove useful to somebody. > > Ben > -- 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.
