Monday, April 21, 2014

#SP24 : #angularJS. Why not #knockoutJS?

+Jeremy Thake in #SP24S058 showed AngularJS basic for SharePoint 2013.
Meanwhile, I have asked people in the web conference room:
Why Angular over Knockout?
and here is the response:

angular is more than a data binding engine, which is what knockout is
 Angular has a different structure and appears to have more features ... at the moment knockout seems easier but like getting used to javascript its just a case of ... getting used to it 
the chart showing the "interest" in Angular exponentially bigger than the other frameworks ...
AngularJS is favored, due to the support of the community. Doing a few searches even around "leaks" shows the community support! 
off the bat, the concepts for service, factory and provider are not in knockout but mostly because there are other ways to do those things ... but that feels more like hacking than using out of box bits :  more directives and customizable directives/tags ... the syntax is different but seems cleaner ...   knockout focuses on purely data binding. angularjs provides a larger framework. either way, leveraging one over the other depends on the reqiurements, right?   if I am just binding, I am fine with Knockout ... but this framework potentially eliminates a lot of the JQUERY lines that I have to support the rest of the app  and here is another thing over knockout ... unless I missed something I can only have one "model" in applyBindings at a time ... this implies I can have many (multiple controllers) ... but I might have missed something advanced in Knockout ... 

What's your take on that? Is that true? Do you prefer knockout? if so, why?
I would love to hear your opinion.

 Back to @jthake main topic: AngularJs bacis
AngularJS facts:

  •  has concept: App, Directives, Service, Factory, Providers.
  •  comes from Google


AngularJs & SP2013?

  • to add  - <div ng-app="myApp">

You can't use templateUrl

  • Instead use JSRequest:



  • use Bootstrap UI


Resources:
SHAREPOINT 2013 APPS WITH ANGULARJS FROM BUILD CONFERENCE 2014

http://jsfiddle.net/ -to develop and collaborate on JS code.

http://blog.nebithi.com/knockoutjs-vs-angularjs/