AngularTS如何将HTML中的输入变量设置为true/false?
我有html:AngularTS如何将HTML中的输入变量设置为true/false?,html,angular,typescript,Html,Angular,Typescript,我有html: <tag-input fullWidth id="inputDir" formControlName="inputDir" [modelAsStrings]="true" [placeholder]="'choice feature'" [allowDupes]="false
<tag-input fullWidth id="inputDir" formControlName="inputDir" [modelAsStrings]="true"
[placeholder]="'choice feature'"
[allowDupes]="falseVariable"
[secondaryPlaceholder]="'choice feature'">
<tag-input-dropdown [showDropdownIfEmpty]="true" [autocompleteItems]="inputDirAutoComplete">
</tag-input-dropdown>
</tag-input>
我错过了什么
(示例中的库是从“ngx芯片”导入{TagInputModule};)
allowDupes
是一个布尔变量,而不是string
变量
在第二个代码段中,您指定了string
变量,而不是boolean
变量
请将[allowDupes]=“false”
替换为[allowDupes]=“false”
,它会起作用。您是否尝试过将“false”
替换为“false”
<tag-input fullWidth id="inputDir" formControlName="inputDir" [modelAsStrings]="true"
[placeholder]="'choice feature'"
[allowDupes]="'false'"
[secondaryPlaceholder]="'choice feature'">
<tag-input-dropdown [showDropdownIfEmpty]="true" [autocompleteItems]="inputDirAutoComplete">
</tag-input-dropdown>
</tag-input>