我收到一个奇怪的错误:
GET http://localhost:3000/app/traceur 404 (Not Found)
我的应用程序构建,但是当我尝试继续它时,它不会加载并且此错误在控制台中出现。出于某种原因,当我删除此组件的directives
部分时,错误消失了:
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 }] );
}
}
任何人都知道发生了什么?过去似乎有一些人遇到过这个错误,但没有一个修复工作对我有用。