添加到MatBottomSheet角5的应用程式不会编译(Adding MatBottomSheet

2019-11-05 03:51发布

我在.netcore 2.0中使用角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'. ../../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'.

Answer 1:

BottomSheet无法获得与mentioned version以上。 你应该考虑升级在一起角与角/材料。

它应该是公正的,

import {MatBottomSheet, MatBottomSheetRef} from '@angular/material';

也尝试使用,

 "@angular/material": "6.0.1",


文章来源: Adding MatBottomSheet to angular 5 app wont compile
标签: angular