- npm run build 失败 提示信息"length"
报错原因:检查 ts 文件中下面地方对应文件名是否正确
@Component({
selector: 'selector-name',
templateUrl: './html-name.component.html',
styleUrls: ['./scss-name.component.scss'],
})
- @Component 下面红线报错
报错原因:类没有被引用到 @NgModule 下的 declarations 中;类中的依赖注入的参数放的位置不对。
- 报错主要是因为lint没有通过,运行命令
npm run lint
会显示报错信息