Category Archives: Angular JS

AngularJS : Gotchas and What to Look Out For

When dealing with Angular and you plan on expanding your code to production then it is very important you create your modules, controllers, services, factories and directives with the proper syntax. As with any piece of JavaScript you can write your code badly. Here are some best practices that should be put in place when writing your AngularJS code.
Continue reading

Angular JS : Best Practices

Controller Best Practices

It is not OK to manipulate the DOM inside the controller.

Its ok to manipulate the DOM in a service. But you should be careful when doing this. Usually it is wrong.

DOM manipulations should only be done inside the Directive or sometimes inside a service.

Minification in JavaScript files : Angular uses reflection when dealing with directives and controllers. Since Angular handles parameters in such a way it is important that we write our Angular controllers using the right syntax.

Continue reading