AngularJS is an incredible JavaScript system that has some extremely convincing highlights for engineers as well as designers too. In this section/ exercise, we will cover what I consider to be the most fundamental highlights, and how they can help make your next web application wonderful.
It is as follows,
It is as follows,
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| MVC Architecture | Two Way Data Binding | Templates | Directives | Expressions | Modules | Scope | Filters |
MVC Architecture
The main imperative component is the MVC or Model-View-Controller engineering. The thought behind utilizing this outline design (engineering), from my perspective, is to divide the web application into a more reasonable structure. The MVC engineering involves three imperative components, the Model, View, and Controller.
Model
The model is the place your information is stored. Either the information we are discussing can be a static information or powerfully got from an information source, tucked in a server that is miles far from the customer, utilizing JSON.
A model includes a straightforward JavaScript question called the degree. Attached to a controller, the model question gets the information (from the source) and conveys it to a view (HTML).
The main imperative component is the MVC or Model-View-Controller engineering. The thought behind utilizing this outline design (engineering), from my perspective, is to divide the web application into a more reasonable structure. The MVC engineering involves three imperative components, the Model, View, and Controller.
Model
The model is the place your information is stored. Either the information we are discussing can be a static information or powerfully got from an information source, tucked in a server that is miles far from the customer, utilizing JSON.
A model includes a straightforward JavaScript question called the degree. Attached to a controller, the model question gets the information (from the source) and conveys it to a view (HTML).
- myApp.controller(
- 'myController',
- ['$scope', function ($greet) {
- $greet.greetings = function () {
- $greet.theguest = 'Hello ' + $greet.name;
- }
- } ]
- );
In the above content, the $scope is a protest in the model. Perceive how it is epitomized inside the controller() technique.
View
In Angular, the view contains HTML components and orders. This is the area of use, which is unmistakable to clients (utilizing a program). Other than markups, each view has as an articulation (with wavy props), which is fixing things up to the extension protest.
View
In Angular, the view contains HTML components and orders. This is the area of use, which is unmistakable to clients (utilizing a program). Other than markups, each view has as an articulation (with wavy props), which is fixing things up to the extension protest.
- <div ng-app="myApp" ng-controller="myController">
- <p>Enter your name <input type="text" ng-model="name"/></p>
- <p><input type="button" value="Click Me" ng-click="greetings()"/></p>
- <p> {{ theguest }} </p>
- </div>
The above bit of markup, otherwise called Template in Angular, when bound, is then called the view.
Controller
The controller really controls the whole business rationale of your application. The underlying stage is set here, that is, it introduces and enrolls the application by making another Angular Module.
Tap the beneath demo connect to see the model, see, the controller that we examined above in a solitary page.
Two-Way Data Binding
Data-Binding makes a connection amongst model and view.
The two-way Data Binding is an uncommon element at any point coordinated in a JavaScript structure. In two-way information, any change made in the view will reflect in the demonstration, likewise changes made in the model will reflect in the view. It is a two-way process.
Controller
The controller really controls the whole business rationale of your application. The underlying stage is set here, that is, it introduces and enrolls the application by making another Angular Module.
Tap the beneath demo connect to see the model, see, the controller that we examined above in a solitary page.
Two-Way Data Binding
Data-Binding makes a connection amongst model and view.
The two-way Data Binding is an uncommon element at any point coordinated in a JavaScript structure. In two-way information, any change made in the view will reflect in the demonstration, likewise changes made in the model will reflect in the view. It is a two-way process.
In Angular, we have to utilize the ng-show mandate to make a two-way information authoritative. This mandate will tie the model to the view. We'll do an example to comprehend the procedure better.
A Two-Way Data-Binding Example,
Let's take the case of an offering procedure. I have set the default cost of an item as "75". Be that as it may, we need our clients to enter their own particular cost for the item.
In the above illustration, I have bound the model variable "offer" to an information box, likewise set a default esteem (75) utilizing ng-init mandate. This is one- route authoritative, since the information box and articulation (with wavy props) shows the model factors esteem. Sufficiently reasonable.
In any case, when the client inputs an alternate esteem, it changes the model variable. A two-way restricting scenario is happening in real life.
Templates
In Angular, a layout typically implies a view with HTML components connected to Angular Directives, include markup for information restricting utilizing articulations (with wavy supports). We will examine about the orders and articulations later in this article.
Layout case
An Angular layout looks essentially like a markup, aside from its qualities. To make it dynamic, be that as it may we have to include a controller and a model.
A Two-Way Data-Binding Example,
Let's take the case of an offering procedure. I have set the default cost of an item as "75". Be that as it may, we need our clients to enter their own particular cost for the item.
- <div ng-app="">
- <p> <label>Current Bid Value</label> <input type="text" ng-model="bid" ng-init="bid ='75'" /> </p>
- <p> ${{bid}} </p>
- </div>
In any case, when the client inputs an alternate esteem, it changes the model variable. A two-way restricting scenario is happening in real life.
Templates
In Angular, a layout typically implies a view with HTML components connected to Angular Directives, include markup for information restricting utilizing articulations (with wavy supports). We will examine about the orders and articulations later in this article.
Layout case
- <div ng-app="app1"> <input type="text" ng-model="expamt" />
- <p> ${{expamt}} </p>
- </div>
Recorded underneath are the components and properties, which make up the layout.
- Directive – In the above illustration, the ng-application and ng-demonstrate are orders.
- Markup – Binding the view with a model utilizing the wavy props {{ offer }} (articulations) is the markup.
- Filters – Filters are helpful for organizing the incentive in an articulation. It is extremely helpful. I have clarified about channels later in this article.
- Form Controls – We can utilize Angular Form Controls to approve client inputs. It gives us a chance to expect the shape has an information field, which acknowledges email ids, as it were. The shape control will approve the information and show a message if the esteem is invalid.
Directives
Directives are qualities connected in the View. Joined to HTML components, the mandates enlarge the components with new practices. Did you see the above illustrations, every component has orders, prefixed with ng-. At whatever point, we connect an order with a component, it discloses to AngularJS that it is a piece of Angular application and Angular treats it that way.
I suggest you read my first article about AngularJS where I have clarified about different orders in detail with cases. Here in this illustration, I have utilized another valuable mandate, called the ng-incorporate, to include the substance of a .htm record.
It has two directives. The first is the ng-application to instate the application. This will inform Angular regarding the application and its highlights. Next is the ng-incorporate order, which is valuable for showing information extricated from an outer record.
Expressions
Directives are qualities connected in the View. Joined to HTML components, the mandates enlarge the components with new practices. Did you see the above illustrations, every component has orders, prefixed with ng-. At whatever point, we connect an order with a component, it discloses to AngularJS that it is a piece of Angular application and Angular treats it that way.
I suggest you read my first article about AngularJS where I have clarified about different orders in detail with cases. Here in this illustration, I have utilized another valuable mandate, called the ng-incorporate, to include the substance of a .htm record.
- <!DOCTYPE html>
- <html>
- <head>
- <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js"></script>
- </head>
- <body>
- <div ng-app>
- <div ng-include="'hello-child.htm'"></div>
- </div>
- </body>
- </html>
Expressions

Abhishek KumarPosted Sep 27, 2017, 9:41 AM
Nice article.......................................