Pass Values from Component to View in Angular 8

This project will demonstrate how to Pass Values from Component to View in Angular 8

  • Angular8
    • src
      • app
        • app.component.html
        • app.component.ts
        • app.module.ts
Age: {{age}}
<br>
Full Name: {{fullName}}
<br>
Status: {{status}}
<br>
Email: {{email}}
import { Component, OnInit } from '@angular/core';

@Component({
    selector: 'app-root',
    templateUrl: './app.component.html'
})

export class AppComponent implements OnInit {

    age: number;
    fullName: string;
    status: boolean;
    email: any;

    ngOnInit() {
        this.age = 20;
        this.fullName = 'abc';
        this.status = true;
        this.email = 'a@gmail.com';
    }

}
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';

@NgModule({
    declarations: [
        AppComponent
    ],
    imports: [
        BrowserModule
    ],
    providers: [],
    bootstrap: [AppComponent]
})

export class AppModule { }

Screenshots