【发布时间】:2021-06-20 01:09:02
【问题描述】:
我正在学习本教程
https://ultimatecourses.com/blog/angular-pipes-custom-pipes
我正在尝试让下面发布的代码正常工作。当我调用命令时
ng servr --open
我收到以下错误:
Error occurs in the template of component Appcomponent
ptoperty file does not exist on type Appcomponent
请告诉我为什么会收到此错误以及如何修复它
app.component.ts:
import { Component } from '@angular/core'
@Component({
selector: 'app-root',
templateUrl: './app.component.html'
})
export class AppComponent {
file = { name: 'logo.svg', size: 2120109, type: 'image/svg' };
}
app.component.html:
{{file.name}}
{{文件大小 |文件大小}}
【问题讨论】:
标签: javascript node.js angularjs angular