In this article ,we learn basic Concepts in angular
Two-way Binding::
Two-way data binding in Angular will help users to exchange data from the component to view and from view to the component. It will help users to establish communication bi-directionally. Two-way data binding can be achieved using a ngModel directive in Angular.
what is ngModel
ngModel is a directive which binds input, select and textarea, and stores the required user value in a variable and we can use that variable whenever we require that value. It also is used during validations in a form.
The ng-model directive binds an HTML form element to a variable in the scope.If the variable does not exist in the scope, it will be created.
Syntax
<element ng-model="name"></element>
Supported by <input>, <select>, and <textarea> elements.
Types of Directives:
1.Components — directives with a template.
2.Structural directives — change the DOM layout by adding and removing DOM elements.
3.Attribute directives — change the appearance or behavior of an element, component, or another directive.
Declarative Vs Imperative:
Declarative programming is a programming paradigm … that expresses the logic of a computation without describing its control flow.
Imperative programming is a programming paradigm that uses statements that change a program’s state.
Module:
Typically module is a cohesive group of code which is integrated with the other modules to run your Angular apps. A module exports some classes, function and values from its code.
Component:
Components are like the basic building block in an Angular application. Components are defined using the @component decorator.
Model:
The model in an MVC-based application is generally responsible for modeling the data used in the view and handling user interactions such as clicking on buttons, scrolling, or causing other changes in the view.
For more understanding watch below video :
https://www.youtube.com/watch?v=-jeoyDJDsSM
Thank you!!!!!
No comments:
Post a Comment