Node.js 角度2-找不到跟踪器
我得到一个奇怪的错误:Node.js 角度2-找不到跟踪器,node.js,angular,npm,Node.js,Angular,Npm,我得到一个奇怪的错误: GET http://localhost:3000/app/traceur 404 (Not Found) 我的应用程序会生成,但当我尝试继续时,它不会加载,并且这个错误会出现在控制台中。出于某种原因,当我删除此组件的指令部分时,错误就会消失: import { Component, OnInit } from '@angular/core'; import { ContextService } from './../../services/ContextService
GET http://localhost:3000/app/traceur 404 (Not Found)
我的应用程序会生成,但当我尝试继续时,它不会加载,并且这个错误会出现在控制台中。出于某种原因,当我删除此组件的指令
部分时,错误就会消失:
import { Component, OnInit } from '@angular/core';
import { ContextService } from './../../services/ContextService';
import { Herd } from './../../classes/shared/herd';
import { Animal } from './../../classes/shared/animal';
import { CalendarWidget } from './../../classes/calendar';
import { Schedule } from 'primeng/components/schedule/schedule.d.ts';
import { Router, ROUTER_DIRECTIVES } from '@angular/router-deprecated';
@Component({
selector: 'dash',
templateUrl: '/templates/Dash/dash.html',
providers: [CalendarWidget],
directives: [Schedule] // when I remove this line then it works
})
export class DashComponent implements OnInit
{
public animals: Animal[];
public constructor(public router: Router, public context: ContextService, public calendar: CalendarWidget) {}
ngOnInit()
{
this.animals = this.context.herd.GetAnimals();
this.calendar.events = this.context.user.getEvents(1);
}
onSelect(animal: Animal) {
this.router.navigate( ['AnimalDetail', { id: animal.ID }] );
}
}
有人知道发生了什么吗?过去似乎有一些人遇到过这个错误,但没有一个修复方法对我有效