AngularJS Essentials

Today, I have taken some time off to talk about a book of a very popular JavaScript framework called AngularJS. The book “AngularJS Essentials” talks about various details of the framework. Let’s check together what we find in the next eight chapters.

Chapter 1: Getting Started with AngularJS

This chapter starts with architectural concepts and setting up the framework. But what I like most is the ‘Organizing the code’ section. It talks about different code organising approaches and personally I like ‘The specific style’ and ‘The domain style’. These approaches are very useful in an enterprise application development where many team members are involved.

Chapter 2: Creating Reusable Components with Directives

This chapter talks about in-built AngularJS directives first and then will introduce you to write your own custom directives. In every example author has deleted the variable from the scope at the end of the controller. I found this is missing in many other books. He concludes the chapter with animation examples.

Chapter 3: Data Binding

You will learn how to handle data in AngularJS using expressions, filters, and forms validation. Simple examples will clarify each of the concepts.

Chapter 4: Dependency Injection and Services

Dependency Injection is one of the fundamental part of AngularJS. Further, author talks about caching and intercepters.

I like the following discussions in this chapter:

  • Different ways to create service.
  • Explaining the JavaScript Reveal Module Pattern since the factory function returns a new object
  • How creating a service using factory function is different than using a service function
  • Intercepter
  • Resolving promises by means of the resolve property, defined inside the when function of the $routeProvider function
  • Use of deferred API using $q.defer()

JavaScript Promise is one of my favourite topic and have given presentation on it at JSChannel-Bengaluru recently.(http://www.meetup.com/JSChannel-Bengaluru/events/182574362/)

You can check my presentation and code examples.

Presentation: http://www.slideshare.net/bhattacharyyapulak/java-script-promises

Code Examples: https://github.com/pulakb/JavaScript-Promises

Chapter 5: Scope

Discussion about scope should have been done much earlier. Though, the highlight of the chapter is ‘Best practices using the scope’. 

Chapter 6: Modules

While explaining modules and how to use it for modular development, in one place grunt-html-to-js plugin is mentioned. It is a useful plug-in for converting AngularJS templates to JavaScript.

Chapter 7: Unit Testing

Unit Testing is one my favourite topic along with JavaScript promises. Author has explained how to write Jasmine specs for each of AngularJS components.

For automating your tests, author has discussed about the use of Karma. He has shown how to install, configure, start and run it. You should also install karma-cli node package using the following command after installing karma:

npm install -g karma-cli

Last April, 2014, I gave a session on ‘Unit testing AngularJS using Jasmine and Karma’ at JSChannel-Bengaluru ( http://www.meetup.com/JSChannel-Bengaluru/events/170998132/ ).

Presentation: http://www.slideshare.net/bhattacharyyapulak/javascript-unittesting

Code Examples: https://github.com/pulakb/UnitTesting

Further, you can check the following link in my blog:

http://pulakonline.com/running-jasmine-unit-test-cases-using-karma

Chapter 8: Automating the Workflow

The final chapter of the book talks in details about Grunt for automating the workflow. If you have not used it before, then also this chapter will give you a fair idea to get you going. The concluding discussion of this chapter is managing packages with Bower which allows us to easily find, install, update, and remove any package from the application.

You can check the below mentioned link for another reference:

http://pulakonline.com/unit-testing-using-karma-and-grunt

Overall, the book is easy to follow, concepts are well explained in shorter version and hence is a recommended book for novice to intermediate level developers interested in AngularJS.

Book Link:  https://www.packtpub.com/web-development/angularjs-essentials

4 thoughts on “AngularJS Essentials

  1. My brother recommended I would possibly like this web site. He was totally right. This post truly made my day. You cann’t imagine simply how much time I had spent for this information! Thank you!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">