Angular 2 - Dynamic Variables in ngModel

前端 未结 5 2053
半阙折子戏
半阙折子戏 2020-12-31 06:58

How to use dynamic variables in ngModel?

I am trying to use the code below but the following error appears:

5条回答
  •  死守一世寂寞
    2020-12-31 07:56

    We would mostly need dynamic ngModel in the case of dynamic text box creation.

    In your ts file

     export class AppComponent {
     public selectedBranch: any[] = [0];
     public selectedShiftNameTime: any[] = [0];
     public CustomDates: any[] = [0];
    }
    

    your HTML file (Template)

     
    Employee Name Branch Shift Type Custom Dates

提交回复
热议问题