基本上这是我的代码:
<div class="container">
<div [hidden]="loggedIn">
<md-grid-list cols="6" [style.margin-top]="'20px'">
<md-grid-tile [colspan]="1"></md-grid-tile>
我已经将 md-input-container 添加到了我的 style.css 文件中。当我在终端中运行 Angular 2 时,它说编译成功。但是当我打开 chrome 浏览器查看实际网站时。它确实有如下错误:
Uncaught Error: Template parse errors: Can't bind to 'colspan' since it isn't a known property of 'md-grid-tile'. 1. If 'md-grid-tile' is an Angular component and it has 'colspan' input, then `verify that it is part of this module. 2. If 'md-grid-tile' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
最佳答案
您需要将其用作,否则它将作为您需要在组件内声明的输入属性
<md-grid-tile colspan="1"></md-grid-tile>
关于javascript - Angular 2 未捕获错误 : Template parse errors:,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48555328/