我正在运行我的应用程序LiveCicle,当我导航到地图路线时,出现此错误:
\n\nERROR Error: Uncaught (in promise): TypeError: _angular_core__WEBPACK_IMPORTED_MODULE_1__.\xc9\xb5\xc9\xb5defineInjectable is not a function\nTypeError: _angular_core__WEBPACK_IMPORTED_MODULE_1__.\xc9\xb5\xc9\xb5defineInjectable is not a function\n at tm.service.ts:9\nRun Code Online (Sandbox Code Playgroud)\n\n这很奇怪,因为我将 tm 服务定义为路由模块中的提供者。
\n\n@NgModule({\n providers: [\n {\n provide:\n HTTP_INTERCEPTORS\n ,\n\n useClass: AuthInterceptor,\n multi: true\n },\n TicketMasterService\n ],\n})\nRun Code Online (Sandbox Code Playgroud)\n\nconst routes: Routes = [\n {path: \'map\', loadChildren: () => import(\'./event-map-page/event-map-page.module\').then(m => m.EventMapPageModule)},\n\n {path: \'**\', redirectTo: \'\', pathMatch: \'full\'},\n\n];\n\n@NgModule({\n imports: [RouterModule.forRoot(routes)],\n exports: [RouterModule]\n})\nexport class AppRoutingModule { }\nRun Code Online (Sandbox Code Playgroud)\n\n我只在生产中遇到此错误。当我在本地运行时,一切正常。
\n\nimport { Injectable, OnInit } from \'@angular/core\';\nimport { …Run Code Online (Sandbox Code Playgroud) 我正在尝试在我的 Angular 8 应用程序中实现Swiper:https : //swiperjs.com/get-started/。
我在我的资产文件夹中创建了一个 javascript 文件并将它包含到我的angular.json.
此外,我在我的中包含了Swiperapp.module.ts并运行了命令
npm install @types/swiper.
但是,我收到错误:
[ts] Module '"../node_modules/@types/swiper/index has no exported member 'Swiper'
当它清楚地这样做时。我不确定我哪里出错了。
card-swipe.component.ts
import { SwiperModule, SwiperConfigInterface } from 'ngx-swiper-wrapper';
@Component({
selector: 'app-card-swipe',
templateUrl: './card-swipe.component.html',
styleUrls: ['./card-swipe.component.css']
})
export class CardSwipeComponent implements OnInit {
constructor() { }
something;
index;
config: SwiperConfigInterface = {
a11y: true,
direction: 'horizontal',
slidesPerView: 3,
slideToClickedSlide: true,
mousewheel: true,
scrollbar: false,
watchSlidesProgress: true,
navigation: true, …Run Code Online (Sandbox Code Playgroud)