简体   繁体   English

Angular ngFor无法使用材质,因为它不是已知属性

[英]Angular ngFor not working with material since it isn't a known property

angular ngfor can't bind to 'ngForOf' since it isn't a known property of angular ngfor不能绑定到ngForOf,因为它不是的已知属性

  <div class="col-md-3 col-sm-3 shadow-sm bg-white rounded leftSideBar">
            <ul class="list-group">
                <mat-radio-group aria-label="Select an option">
                    <li class="list-group-item" *ngFor="let item of items">
                        {{i.name}}
                        <mat-radio-button [value]="i.id"></mat-radio-button>
                    </li>
                </mat-radio-group>
            </ul>
        </div>

Add BrowserModule to imports: [] in AppModule BrowserModule添加到imports: [] AppModule imports: []

import { BrowserModule } from '@angular/common';
..
..
@NgModule({
  imports: [ BrowserModule ],
  ..
})

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Angular:ngFor中的三元运算符抛出错误无法绑定到“ ngFor”,因为它不是“ div”的已知属性 - Angular: ternary operator in ngFor throw error Can't bind to 'ngFor' since it isn't a known property of 'div' Angular 2 RC5:无法绑定到&#39;ngFor&#39;,因为它不是已知的属性 - Angular 2 RC5: Can't bind to 'ngFor' since it isn't a known property of Angular 2 * ngFor错误:无法绑定到“ menuitemtype”,因为它不是“ div”的已知属性 - Angular 2 *ngFor error: Can't bind to 'menuitemtype' since it isn't a known property of 'div' 无法绑定到“ngForOf”,因为它不是 ngFor Angular 中“li”的已知属性 - Can't bind to 'ngForOf' since it isn't a known property of 'li' in ngFor Angular 无法绑定到“ngFor”,因为它不是...在混合 AngularJS 和 Angular 应用程序上的已知属性 - Can't bind to 'ngFor' since it isn't a known property of ... on hybrid AngularJS & Angular application 无法绑定到“ ngFor”,因为它不是已知的本机属性 - Can't bind to 'ngFor' since it isn't a known native property “无法绑定到&#39;ngFor&#39;,因为它不是已知的本机属性” - “Can't bind to 'ngFor' since it isn't a known native property” 无法绑定到“*ngFor”,因为它不是“div”的已知属性 - Can't bind to '*ngFor' since it isn't a known property of 'div' 无法绑定到“formControl”,因为它不是“输入”的已知属性 - Angular 材料自动完成,Angular 12 - Can't bind to 'formControl' since it isn't a known property of 'input' - Angular Material Autocomplete, Angular 12 无法绑定到“formControl”,因为它不是“输入”的已知属性 - Angular2 Material Autocomplete 问题 - Can't bind to 'formControl' since it isn't a known property of 'input' - Angular2 Material Autocomplete issue
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM