Alles war gut in Angular 2. Allerdings habe ich auf die Beta-Version von 4 aktualisiert und einen NoAnnotationError beim Start erhalten. Ich habe keine Dienste, noch keine Injektionen.Unerklärliche "NoAnnotationError" auf Upgrade auf Angular 4
Hier ist mein Code:
app.ts
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app.module';
platformBrowserDynamic().bootstrapModule(AppModule);
app.component.ts
require('./sass/index');
import 'zone.js';
import 'reflect-metadata';
import { Component } from '@angular/core';
@Component({
selector: 'my-app',
template: `
<div class="app">
The Angular app has now loaded!
<router-outlet></router-outlet>
</div>`
})
export class AppComponent {
error: any;
showNgFor = false;
constructor()
{
}
}
app.module.ts
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { HttpModule } from '@angular/http';
import { RouterModule } from '@angular/router';
import { AppComponent } from './app.component';
@NgModule({
imports: [
BrowserModule,
HttpModule,
RouterModule.forRoot([])
],
declarations: [ AppComponent ],
bootstrap: [ AppComponent ]
})
export class AppModule { }
Es ist ziemlich einfach Sachen ... nicht sicher was ich kann Sie könnten hier nicht kommentieren.
Und hier ist der vollständige Fehler:
Error: Cannot resolve all parameters for 'Parser'(?). Make sure that all the parameters are decorated with Inject or have valid type annotations and that 'Parser' is decorated with Injectable.
Werfen Sie einen Blick auf die Dokumentation ... ups gibt es keine für Angular4. =) – lin
Eine Vermutung hier ... als Sie zu NG4 gewechselt haben, haben Sie alle anderen Dinge aktualisiert, auf die es in Ihrem Paket ankommt.json? Wie die neueste Version von TypeScript? –