作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在运行我的应用程序 LiveCicle当我导航到 map 路线时,我收到此错误:
ERROR Error: Uncaught (in promise): TypeError: _angular_core__WEBPACK_IMPORTED_MODULE_1__.ɵɵdefineInjectable is not a function
TypeError: _angular_core__WEBPACK_IMPORTED_MODULE_1__.ɵɵdefineInjectable is not a function
at tm.service.ts:9
@NgModule({
providers: [
{
provide:
HTTP_INTERCEPTORS
,
useClass: AuthInterceptor,
multi: true
},
TicketMasterService
],
})
const routes: Routes = [
{path: 'map', loadChildren: () => import('./event-map-page/event-map-page.module').then(m => m.EventMapPageModule)},
{path: '**', redirectTo: '', pathMatch: 'full'},
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }
import { Injectable, OnInit } from '@angular/core';
import { HttpClient, HttpParams, HttpHeaders } from '@angular/common/http';
import { environment } from '../../environments/environment';
import { DataService } from '../../services/dataService/data.service';
import { TmEvent } from '../../models/tmEvent/tm-event.model';
@Injectable()
export class TicketMasterService {
noAuthHeader = { headers: new HttpHeaders({ 'NoAuth': 'True'})};
private readonly TM_EVENTS = 'TM_EVENTS';
tmEvents: any = [];
constructor(private http: HttpClient, private data: DataService) {
}
fetchTmData() {
this.http.get(environment.apiBaseUrl + '/ticketmaster-events', this.noAuthHeader).subscribe(res => {
this.getTheFields(res);
});
}
}
最佳答案
我尝试了类似的问题
转至 ./node_modules/ng-inline-svg/lib_esmodule/svg-cache.service.js
并搜索 ɵɵ
并删除它
或点击错误并搜索ɵɵ
并删除它
我希望这对任何人都有用
关于Angular TypeError : _angular_core__WEBPACK_IMPORTED_MODULE_1__. ɵɵdefineInjectable 不是函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62256725/
我是一名优秀的程序员,十分优秀!