Tips from AngularUI Founder: How to Persuade Clients to Adopt AngularJS
Codementor AngularJS expert and founder of the Angular UI organization, Dean Sofer, joined us during an AngularJS open office hours for an open Q&A session. One of our viewers wished to know if there was anything Dean did to “wow” people to convince them to go with AngularJS.
Dean’s tips is as follows:
The text below is a summary done by the Codementor team and may vary from the original video and if you see any issues, please let us know!
To “wow” people, I always literally write do a to-do list in pure HTML, no Javascript. It’d have things like NG class, NG click, NG if, NG repeat, and even NG init. It’s not a good practice, because in a real app I would have offloaded more into the controller, but I would use the demonstration to show I can build the entire project in pure HTML and put all the logic in HTML. Then I’d create a global function and usedthe as syntax (controller as something). I don’t even have to inject scope. I just had to do this.add=afunction
, and this.item=anarray
.
I do this it right in front of people within fifteen minutes, and I got all these features done. If you use UI utils, there are event bindings for keyboard events (e.g. the return key, the space key, the backspace key and the escape key.) I could do all that in the template, so even in HTML I had the binding, and I didn’t use any controller whatsoever. This just sells people so fast, so you can try it out if you want to persuade clients to use Angular for their projects.
Other posts in this series with Dean Sofer:
- AngularJS Office Hours: Best Practices, UI-Router, and ORM
- What Should Beginners Choose: Angular, Ember, or Backbone?
- Angular Tutorial: Solving Asynchronous Problems with Resolve
- AngularJS Tutorial: If You Have Circular Dependencies, You’re Doing Something Wrong