Angular 嵌入模板上的任何指令都不使用属性绑定
我正在使用延迟加载方法。因为我有这个问题Angular 嵌入模板上的任何指令都不使用属性绑定,angular,lazy-loading,Angular,Lazy Loading,我正在使用延迟加载方法。因为我有这个问题 Property binding ngForOf not used by any directive on an embedded template. Make sure that the property name is spelled correctly and all directives are listed in the "@NgModule.declarations". 用下面的代码 <li ngFor="let page of p
Property binding ngForOf not used by any directive on an embedded template. Make sure that the property name is spelled correctly and all directives are listed in the "@NgModule.declarations".
用下面的代码
<li ngFor="let page of pager.pages" [ngClass]="{active:pager.currentPage === page}">
<a (click)="setPage(page)">{{page}}</a>
</li>
{{page}
ngFor的语法将是*ngFor
,我想你忘了把*
放在ngFor
之前了
<li *ngFor="let page of pager.pages" [ngClass]="{active:pager.currentPage === page}">
<a (click)="setPage(page)">{{page}}</a>
</li>
{{page}
如果没有任何语法错误,问题可能是在NgModule中导入“CommonModule”