I encountered an issue in my Angular 2 application where I attempted to bind view data using ngModel, but it did not function as expected.
event.component.html
<div class="form-group">
<label for="comment">About Us:</label>
<input type="text" name="aboutus" class="form-control"
[(ngModel)]="home.aboutus" required placeholder="aboutus"/>{{home.aboutus}}
</div>
homemenu.ts
export class Home {
aboutus: string;
}
eventcomponent.ts
export class EventComponent {
home:Home;
}
constructor() {
}