I am new in angular and my sir give me the exercise to get input field data in p element by clicking on a button using angular 7.I do so much attempts using some functions (onClick,onClickSubmit,myFunction) but i failed in every attempt.I think i got problem in data-binding / event-binding.Please help me to sort out this problem.
app.component.html :
<input type="text" [(ngModel)]="name" name="name">
<br><br>
<button (Click)="onClick">Show</button>
<p>{{name}}</p>
app.component.ts :
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'angular7-app';
show(){
this.show =
}
}