- @Component({
- selector:'courses',
- template:`.......
- "text" [(ngModel)]="newCourse" />
- "button" value="Add Course" (click)="AddCourse()"/>
- })
- export class CoursesComponent{
- AddCourse()
- {
- this.courses.push(this.newCourse);
- }
- }
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Madhanmohan DevarajanPosted Oct 26, 2017, 10:54 AM
Please go through the below links, hope that helps to resolve your issues.
http://www.c-sharpcorner.com/forums/how-to-bind-textbox-in-angular-2