Concept In Angular Day 14

Lecture 14 : Concept In Angular

What is ngModel :

  • ngModel is Angular’s answer to the two-way data binding problem.

  • Previously in AngularJS, there was no way to perform a binding which would update automatically.

What are Directives :

  • Directives are markers on a DOM element that tell AngularJS to attach a specified behaviour to that DOM element or even transform the DOM element and its children.

  • Angular includes various built-in directives. In addition to this, you can create custom directives for your application.

ng-model Directive :


  • The ng-model directive binds the value of HTML controls (input, select, textarea) to application data.

  • With the ng-model directive you can bind the value of an input field to a variable created in AngularJS.

Two-Way Binding :


  • The binding goes both ways. If the user changes the value inside the input field.

  • Two-way binding, we can display a data property as well as an update that property when the user makes changes.

  • Two-way binding works in both directions are setting the value and fetching the value. 

  • The two-way binding uses a specific name pattern.

Component :

  • Decorator that marks a class as an Angular component and provides configuration metadata that determines how the component should be processed, instantiated, and used at runtime.

  • A component must belong to an NgModule in order for it to be available to another component.

Module :
  • In Angular, a module is a mechanism to group components, directives, pipes and services that are related, in such a way that can be combined with other modules to create an application.

  • An Angular application can be thought of as a puzzle where each piece (or each module) is needed to be able to see the full picture.

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.


View :
  • AngularJS supports Single Page Application via multiple views on a single page. 

  • To do this, AngularJS has provided ng-view and ng-template directives.

  • Simple Structure :


Declarative Vs Imperative :
  • Angular is built around the belief that declarative code is better than imperative when it comes to building UIs and wiring software components together, while imperative code is excellent for expressing business logic.

  • It is a very good idea to decouple DOM manipulation from app logic.

Declarative :
  • Declarative is a programming paradigm that expresses the logic of a computation(What do) without describing its control flow(How do).

  • The declarative programming try to blur the distinction between a program as a set of instructions and a program as an assertion about the desired answer.

Imperative :
  • Imperative is a programming paradigm that describes computation in terms of statements that change a program state.

  • The imperative programs can be dually viewed as programming commands or mathematical assertions.

Comments

Popular posts from this blog

Basic Concept In C Sharp Day 16

Understanding C Sharp Day 18