Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/30.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular ngIf selected item为特定值,则_Angular_Angular Material2_Angular Forms - Fatal编程技术网

Angular ngIf selected item为特定值,则

Angular ngIf selected item为特定值,则,angular,angular-material2,angular-forms,Angular,Angular Material2,Angular Forms,我正在尝试用有角度的材质创建一个有角度的形状。现在我正在努力解决这个问题。当我在带有标签“type behandeling”的选择选项中选择一个值时,需要使用占位符“begin tijd”设置下一个输入字段的值 贝汉德林型 {{typeCure.viewValue}} 例如,如果选择字段的值为“Sittard”,则输入字段的值必须为“13:00” 有人能帮我解决这个问题吗?谢谢 你可以这样试试 HTML <mat-form-field> <mat-label>T

我正在尝试用有角度的材质创建一个有角度的形状。现在我正在努力解决这个问题。当我在带有标签“type behandeling”的选择选项中选择一个值时,需要使用占位符“begin tijd”设置下一个输入字段的值


贝汉德林型
{{typeCure.viewValue}}
例如,如果选择字段的值为“Sittard”,则输入字段的值必须为“13:00”

有人能帮我解决这个问题吗?谢谢

你可以这样试试

HTML

 <mat-form-field>
  <mat-label>Type behandeling</mat-label>
  <mat-select [(ngModel)]="data.cure" >
    <mat-option *ngFor="let typeCure of typeCures" [value]="typeCure.value" (selectionChange)="doSomething(typeCure.value)">
         {{typeCure.viewValue}}
     </mat-option>
  </mat-select>
 </mat-form-field>

  <mat-form-field>
      <input matInput type="time" placeholder="Begin tijd [(ngModel)]="selectedValue">
  </mat-form-field>
 <mat-form-field>
  <mat-label>Type behandeling</mat-label>
  <mat-select [(ngModel)]="data.cure" >
    <mat-option *ngFor="let typeCure of typeCures" [value]="typeCure.value" (selectionChange)="doSomething(typeCure.value)">
         {{typeCure.viewValue}}
     </mat-option>
  </mat-select>
 </mat-form-field>

  <mat-form-field>
      <input matInput type="time" placeholder="Begin tijd [(ngModel)]="selectedValue">
  </mat-form-field>
  selectedValue: any;
  doSomething(data) {
   this.selectedValue = data;
  }