User Input with - [(ngModel)]
Angular uses two way data binding for input tags
Angular 2 way data-binding
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';
import { AppComponent } from './app.component';
@NgModule({
imports: [ BrowserModule, FormsModule ],
declarations: [ AppComponent ],
bootstrap: [ AppComponent ]
})
export class AppModule { }Import { Component } from "@angular/core"; (
@Component({
selector: "my-component",
templateURL: './my.component.html'.
styles: [['h1 { font-weight: normal; }']]
})
export class MyComponent {
name = ""
}

Last updated