Skip to content

Instantly share code, notes, and snippets.

@alemohamad
Last active April 17, 2019 10:41
Show Gist options
  • Save alemohamad/5f75aabfb81e9b471f4b2a9dd4652565 to your computer and use it in GitHub Desktop.
Save alemohamad/5f75aabfb81e9b471f4b2a9dd4652565 to your computer and use it in GitHub Desktop.
Angular 7 component with ngModel data binding.
<h1>{{ title }}</h1>
<input type="text" [(ngModel)]="title">
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-contact',
templateUrl: './contact.component.html',
styleUrls: ['./contact.component.scss']
})
export class ContactComponent implements OnInit {
title = 'Contact section';
constructor() { }
ngOnInit() { }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment