Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typescript/8.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 6中切换输入?_Angular_Typescript_Angular6 - Fatal编程技术网

如何在Angular 6中切换输入?

如何在Angular 6中切换输入?,angular,typescript,angular6,Angular,Typescript,Angular6,我想切换我的选择,然后根据我选择的内容显示另一个输入 Owned: <select ngModel="selectedValue"> <option value="true">Yes</option> <option value="false">No</option> </select> <input *ngIf="selectedValue==false" type="date"> 拥有: 对 不 对

我想切换我的选择,然后根据我选择的内容显示另一个输入

Owned:
<select ngModel="selectedValue">
 <option value="true">Yes</option>
 <option value="false">No</option>
</select>
<input *ngIf="selectedValue==false" type="date">
拥有:
对
不

对
不
所选值为:{{selectedValue}}

对
不
所选值为:{{selectedValue}}

[(ngModel)]=“selectedValue”
此外,您可以使用
*ngIf=“!selectedValue”
[(ngModel)]=“selectedValue”
此外,您还可以使用
*ngIf=“!selectedValue”
谢谢,这行代码解决了我的问题“selectedValue='false'”-->“false”谢谢,这行代码解决了我的问题“selectedValue='false'”-->“假”
<select [(ngModel)]="selectedValue">
  <option value="true">Yes</option>
  <option value="false">No</option>
</select>
<div *ngIf="selectedValue"> Selected value is: {{selectedValue}}</div>
<input *ngIf="selectedValue == 'false'" type="date">