Posts

Showing posts from December, 2018

4. Interpolation in Angular

Interpolation in Angular Introduction 1. Interpolation is one type of binding where we can bind the data for display. 2. We can perform mathematical operations, conditional operations e.c.t. 3. Interpolation always converts the result to string type before display or before assigned. 4. Interpolation can also be used for element properties whose return type or expected type is string type. examples : type, placeholder e.c.t. 5. Interpolation can't be used for element properties whose return type or expected type is other than string. examples: required, readonly e.c.t 6. If we are trying to use interpolation for the element properties whose return type or expected type is other than string , then we wont get any errors but result's with the default value of that particular property. Examples 1. app.component.html 2. app.component.css 3. app.component.ts In app.component.html  <h1>Ways of using Interpolation</h1> ...

3. Data Binding in Angular

Data Binding in Angular 1. What is Data binding ? 1. Binding the model data between view and controller is called as Data Binding 2. In Angular Data Binding can be achieved in two ways: a. One Way Data Binding. b. Two Way Data Binding. One Way Data Binding  1. Binding the data from controller to view or view to controller is called one way data binding. 2. One Way data binding is again classified into two ways a. Controller to View. b. View To controller. Controller to view Data Binding  1. Binding the data from controller to view is called controller to view data binding. 2. Controller to view binding is again classified into 5 types a. Interpolation. b. Property Binding. c. Attribute binding. d. Style Binding. e. Class Binding.  V iew  to  Controller  Data Binding  1. Binding the data from view to controller is called View to controller Data binding. 2. Controller to view binding is again classified ...

MVC or MVVC Pattern In Angular

Image
MVC or MVVC Pattern In Angular MVC - Model - View - Controller 1. In Angular every component will follow MVC pattern. 2. MVC indicate's - Model - View - Controller. 3. Model is the raw data or the data from remote. 4. View indicate's look and feel. 5. Controller acts as the mediator between Model and View. 7. In angular view can be achieved by HTML and CSS , Model indicates the object Controller indicates data transmission between View and Model. 8. In Angular each component will have all Model, View, Controller. So Angular is called Component based MVC. 9. In Angular it follow's two way binding i.e.. Data transmission between Model - view - view - controller hence it is also called as MVVC. 10. So angular can be called as MVC or MVVC. Files Indicating MVC in Angular. Model - component.model.ts View - component.html , component.css Controller - component.ts, component.service.ts Note There is still a dilama and debet weather angular i...