选中的属性在我的html模板中不起作用
当我实现html模板时,checkbox的checked属性不能正常工作 我的html文件包含如下代码:选中的属性在我的html模板中不起作用,html,angular,Html,Angular,当我实现html模板时,checkbox的checked属性不能正常工作 我的html文件包含如下代码: <div *ngIf="userPermissionObj" > <label for="pm">Permissions:</label> <div *ngFor="let pt of permissionType"> <lab
<div *ngIf="userPermissionObj" >
<label for="pm">Permissions:</label>
<div *ngFor="let pt of permissionType">
<label>
<input type="checkbox"
[value]="pt.id"
ng-checked="${userPermissionObj.sPermissionType} == ${pt.name} ? true : false" />
{{pt.name}}
</label>
</div>
权限:
{{pt.name}
我怎样才能找出我在哪里以错误的方式实现了呢?使用
[checked]
而不是ng checked
(这是angularJS指令,不是angular.io)
参见下面的示例
<input type="checkbox"
[value]="pt.id"
[checked]="${userPermissionObj.sPermissionType} == ${pt.name} ? true : false" >
使用
[checked]
而不是ng checked
(这是angularJS指令,不是angular.io)
参见下面的示例
<input type="checkbox"
[value]="pt.id"
[checked]="${userPermissionObj.sPermissionType} == ${pt.name} ? true : false" >
在新角度中,检查的ng不存在。要实现同样的效果,请使用
[选中]
:
在新角度中,检查的ng不存在。要实现同样的效果,请使用[选中]
:
选中的ng在angular中不存在。它是古老的安格拉斯的一部分。使用[checked]
而不是在angular中不存在checked。它是古老的安格拉斯的一部分。改用[选中]