AngularJS, Front End Development
Modularizing your application is a good practice because it makes the components reusable, configurable and testable. As we know that angular is on the global scope itself whereas angular.module is a global place to create, register or retrieve angular modules. In other words, angular.module is a container for other units of your...
AngularJS, Front End Development
In AngularJS, immediate model updates is a default behavior but if we want to persist value in the object after a certain time period has elapsed then we can achieve the same by using "debounce" object in "ng-model-options" directive, which is known as "non-immediate model updates". Immediate Model updates [html] <div...
AngularJS, Front End Development
When a function of service or controller invoked via the injector then we have to annotate these functions so that the injector knows what service to inject into the function. In Angular, there are three ways of annotating code with service name - Inline Array Annotation $inject Property Annotation Implicit Annotation ...
AngularJS, Front End Development
In AngularJS, there are three ways to register a service in a module. Module's Factory Function Module's Config via $provide Module's Service Function Via Module's Factory Function We can register a service via Angular module’s "factory" function. This is commonly use to register a service. Registering service in...
AngularJS, Front End Development
AngularJS Deferred & Promises- Basic Understanding Table of Contents 1. Introduction to Asynchronous AngularJs 2. Callbacks- Basic Understanding 3. Callback Hell 4. Promise- A Better way of handling callbacks 5. Promise In AngularJS- $q Service 6. Deferred API 7. Promise API 8. Some other promise based...
AngularJS, Front End Development
Angular provides a very powerful means to transfer messages to scopes at different hierarchical level. We can dispatch an event upwards through the scope hierarchy by notifying all the registered "$rootScope.Scope" listeners in the hierarchy or downwards to all the child scopes. Angular provides these two functions to achieve the event...
Recently I discovered that every directive in AngularJS has a priority score assigned to it. While the page is loaded the priority plays a very important role in setting the order of the execution of various directives in single DOM Element. The priority is used to sort the directives before their "compile" function gets called. In simple...
Angular provide services for handling non-view logic, communication with server(back-end) and can holds data & state. These services are singleton objects that can be used to share and organize code. For doing so, angular provides us five cool ways to make a service on the bases of once need. Following are the five approaches that...
In AngularJS, we can easily write our own custom directives to achieve required functionality. There are certain attributes which we provide in directive definition like restrict , scope , template, link, transclude etc. There is one more attribute named : require , which gives us the liberty to include another directive and inject...
Wait, Trans .. what? Yes, Transclusion is the mysterious, big and most intimidating of words when writing AngularJS Components. AngularJS, being so powerful and all provides a lot of ways to do many things. Now writing directives is not a very complex exercise, infact it is quite simple now if you first have a look at the...
Ever wondered that the most time consuming tasks are the one you have done numerous times on numerous projects, and why the hell am i doing it again? The most basic of examples of this is Scaffolding an app, you have to do a lot of things, repetitive things to get the app structure up to speed. This is an even bigger problem with...
When we work on AngularJS, scope become very important concept. So today we will understand the Scope in AngularJS. In almost every AngularJS Controller we use scope object which is auto injected by AngularJS in $scope named parameter. And that scope gets visible to marked HTML and its inner/child HTML, because of which HTML can access...