- @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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Madhanmohan DevarajanRank #342 · 7.3K reputationPosted Oct 26, 2017, 6:54 AM EDT
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