When we want to communicate from component class to template ,we can use interpolation which use the {{ expression }} to render the bound value to the component’s template.
Step 3 : app.module.ts is root module which is shown below and AppModue is route modules which bootstraps and launches the angular application.
Step 1 : Create an angular 5 project from here https://programmergangtuts.blogspot.com/2018/02/creating-first-angular-5-project.html and copy and paste the following code in src->app->app.component.ts
import { Component } from '@angular/core'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent { firstName:string="Mani"; //defining first name field in typescript lastName:string="Rai"; //defining last name field in typescript getFullName():string //method returning first name and last name { return this.firstName +" " +this.lastName; } }Step 2 : paste the following code in src->app->app.component.html
Full Name : {{getFullName()}} //interpolation
Step 4 : Go to View -> Integrated terminal then terminal will open .
thanks for sharing nice information
ReplyDeleteAngular 5 training in Hyderabad
As we know there are many companies which are converting into Google Cloud Big Data Services with the right direction we can definitely predict the future.
ReplyDeleteThank you for your articles that you have shared with us. Hope you can give the article a good benefit to us
ReplyDeleteMachine Learning Course in Bangalore
Artificial Intelligence Training in Bangalore
I think this is an informative post and it is very useful and knowledgeable. Really its Great Article . Hire AngularJS developer to create enriching content and impress maximum readers and potential customers.
ReplyDeletehire angularjs developer
Useful steps
ReplyDeletenice. keep posting
ReplyDeletepower bi Training in kphb