Now a day’s most of the users showing interest in single page applications, suddenly a doubt strikes in your mind, what is single page application (SPA)?
So let me explain in detail about single page apps, Google employee started the work on angularjs, idea turns very well and now Google officially providing support to angular js.
Angularjs uses mvc framework, mvc means (model, view and controller).
To develop Angular applications (spa) you need to have basic knowledge in
Now let me walk through features of angularjs
• Data Binding: In Angularjs data binding plays a major important role, here data synchronization done automatically between model and view components.
• Services: There are two types of services
1. Lazily instantiated
If the component there in the application, then angular service will be initiated.
Each and every component dependent on a service get reference to single instance is generated by a service factory.
Example service: $http
How to create a angular service?
Within the file write below code to create your first service.
• Scopes: Scope is used to joining application controller and view, in template linking phase the directives set up expressions on the scope.
Example: Now I will display textbox value using scope.
Now let’s see html code below
• Dependency Injection :
Components get hold of their dependencies is known as dependency injection, angular injection subsystem creates components which resolve dependencies, and provides other components as requested.
Now let’s check small example below
Above we create a service to display textbox value, now we use injector how to build a service.
Now we will create a new injector that will provide components defined in our myfirstservice, and request the uservalue service from the injector.
Thanks for reading this article.