sae*_*med 5 visual-studio asp.net-core angular
我想以我的有角形式显示敬酒通知。我正在使用Visual Studio .net Core 2.1模板...我正在
运行localhost时无法获取/错误...
运行ng build并显示以下错误...
../../../../../node_modules/ng2-toasty/index.d.ts(1,37):错误TS2307:找不到模块'@ angular / core'。../../../../../node_modules/ng2-toasty/src/shared.d.ts(1,30):错误TS2307:找不到模块'@ angular / platform-browser'。../../../../../node_modules/ng2-toasty/src/shared.d.ts(2,31):错误TS2307:找不到模块'@ angular / core'。../../../../../node_modules/ng2-toasty/src/toast.component.d.ts(1,30):错误TS2307:找不到模块'@ angular / core'。../../../../../node_modules/ng2-toasty/src/toasty.component.d.ts(1,24):错误TS2307:找不到模块“ @ angular / core”。../../../../../node_modules/ng2-toasty/src/toasty.service.d.ts(1,28):错误TS2307:找不到模块“ rxjs / Observable”。
AppModule:
import { VehicleFormComponent } from './vehicle-form/vehicle-form.component';
import { VehicleService } from './services/vehicle.service';
import { ToastyModule } from 'ng2-toasty';
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpClientModule } from '@angular/common/http';
import { RouterModule } from '@angular/router';
@NgModule({
declarations: [
AppComponent,
NavMenuComponent,
HomeComponent,
VehicleFormComponent
],
imports: [
BrowserModule.withServerTransition({
appId: 'ng-cli-universal'
}),
FormsModule,
HttpClientModule,
FormsModule,
ToastyModule.forRoot(),
RouterModule.forRoot([
{
path: '',
component: HomeComponent,
pathMatch: 'full'
},
{
path: 'vehicles/new',
component: VehicleFormComponent
}
])
],
providers: [VehicleService],
bootstrap: [AppComponent]
})
export class AppModule {}
Run Code Online (Sandbox Code Playgroud)
我遇到了同样的问题。您需要对app.module.ts文件进行一些更改,该文件主要在 (..\ClientApp\src\app\app.module.ts) 中提供。只需从应用程序中删除已删除的组件和声明.module.ts
| 归档时间: |
|
| 查看次数: |
4586 次 |
| 最近记录: |