我在.netcore 2.0中使用Angular 5,并且我的应用编译良好,直到我添加了:
import { MatBottomSheet, MatBottomSheetRef } from '@angular/material/bottom-sheet';
,如果我删除导入,则应用编译正常。我在网上看到了一些示例,这些示例仅从'@angular/material'
导入,但是我没有正在使用的选项:
`"@angular/animations": "^5.2.0",
"@angular/cdk": "^5.2.0",
"@angular/common": "^5.2.0",
"@angular/compiler": "^5.2.0",
"@angular/core": "^5.2.0",
"@angular/forms": "^5.2.0",
"@angular/http": "^5.2.0",
"@angular/material": "^5.2.0",`
某些错误(无法找到所有具有不同扩展名的错误):
../../node_modules/@angular/material/stepper/typings/step-header.d.ts(9,71): error TS2307: Cannot find module '@angular/core'.
../../node_modules/@angular/material/stepper/typings/step-label.d.ts(8,29): error TS2307: Cannot find module '@angular/core'.
../../node_modules/@angular/material/stepper/typings/stepper-icon.d.ts(8,29): error TS2307: Cannot find module '@angular/core'.
../../node_modules/@angular/material/stepper/typings/stepper-intl.d.ts(1,25): error TS2307: Cannot find module 'rxjs'.
../../node_modules/@angular/material/stepper/typings/stepper.d.ts(11,91): error TS2307: Cannot find module '@angular/core'.
答案 0 :(得分:1)
BottomSheet在上面的 mentioned version
中不可用。您应该考虑同时升级角度和角度/材质。
应该是公正的
import {MatBottomSheet, MatBottomSheetRef} from '@angular/material';
也尝试使用
"@angular/material": "6.0.1",