Ara*_*ash 6 angular2-template angular
我有一个模特
class AnnouncementDocument {
Id: String;
IsDeleted: Boolean;
Name: String;
TemporaryName: String;
Description: String;
AnnouncementDocumentTypeId: Number;
}
Run Code Online (Sandbox Code Playgroud)
在我正在使用的模板中
*ngIf="announcementDocumentTypeId==1
Run Code Online (Sandbox Code Playgroud)
我得到了错误
[Angular] Expected the operants to be of similar type or any
Run Code Online (Sandbox Code Playgroud)
正确,因为模板中的1被视为字符串而非数字
我该如何解决这个问题?
| 归档时间: |
|
| 查看次数: |
7847 次 |
| 最近记录: |