Saturday, November 16, 2019

Interpolation in Angular 6

Interpolation is a technique that allow the user to bind a value to a UI element . two curly braces are used for this {{}} . It is called a Template Expression

See my VDO on Shubh Techno Expert Channel 

app.component.html




   

Interpollation



   


       

           
                Email ID
               
                                ngModel width="100%">
           
           
                password
               
                                 ngModel width="100%">

           
           
                 
               
               
             
           
           
                My Mail ID is :
               
                             value="{{userlogin1.value.emailid}}">
           
       



   
    {{userlogin1.value.emailid}}
    This is incremented Value : {{1+ 1}}

    Sum of :


sum of : {{10 + 20 + 30}}


{{userlogin1.value.emailid}}


{{'This is My Email id ' + userlogin1.value.emailid}}




app.component.ts

import { Component, OnInit } from '@angular/core';


@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class appComponent {

  myEmail:any;
  constructor() { }

  ngOnInit() {  }

  onClickSubmit(data) {
   debugger
    this.myEmail = data.emailid;
    alert("Entered Email id : " + data.emailid +"   " + data.passwd);
  }

  
}

No comments:

Post a Comment

Mat Table Angular

Mat Table in Angular Mat table is used to display data . its a material designed styled data-table . For using Material Table MatTableMo...