I was really excited about getting to use AngularJS and the experience has been great so far. In this post, I am going to give you a glimpse of the AngularJS goodies and hopefully it will clear up your path in learning AngularJS.
First of all, why AngularJS? Since you have been looking to learning AngularJS, you probably already have your answer. Basically, AngularJS provides full support for building Single Page Applications(SPA). Everything you need to build a SPA, such as DOM manipulation, routing, history management, AngularJS has it covered. AngularJS is a MVC framework which enforces the separation of these three layers to achieve loose coupling.
There are a few new core concepts that you need to know to get a head start.
- Directives is a function understood by HTML. It is usually defined in HTML either as a DOM node attribute, ng-app and ng-controller for example, and some of them can be defined as tag name like ng-view.
- Controllers handle custom logic used to display data in views which is HTML.
- Filter is used for formatting data, for example, display date in different date formats.
- Routing defines a path to a view/controller
- Module acts as a big container for different components.
- Factory/service are singletons and used to store re-useable business logic and data/state that is shared between controllers. While they serve the same purpose, they are constructed in different ways. A factory function has to return an object at the end and can’t be injected as early as module.config. A service function doesn’t return an object and all the properties need to be set in the “this” scope variable and can be injected in module.config.
Moving on, there are just so many great places to check out if you want to read more…
- Online courses
1. Free course “Shaping up with Angular.js” by Code School – https://www.codeschool.com/courses/shaping-up-with-angular-js.
I love how it gives you hands-on experience of coding AngularJs and provides detailed feedback if your code misses anything.
2. Egghead.io – https://egghead.io
More than a hundred classes, including the ones need pro account($15/month). You can still find lots of good free courses. They have a quick guide to get started but other than that, the courses are listed in random order.
3. AngularJS JumpStart with Dan Wahlin – https://www.udemy.com/angularjs-jumpstart/
It’s a $149 online course but you can probably find some coupon code online. It has 80 lectures from the overview of AngularJS to using the animation. Lots of details of the core components of AnuglarJS.
1. AngularJS by Brad Green and Shyam Seshadri
It’s a quick read of AngularJS. Good for beginners but there are some typos in the sample code.
2. Pro AngularJS by Adam Freeman
Advanced programming in AngularJS. My favorite is Chapter 16 – “creating complex custom directives”. Lots of diagrams to explain how the scope works.