Angularjs 莫名其妙;“无注释错误”;升级到Angular 4时

Angularjs 莫名其妙;“无注释错误”;升级到Angular 4时,angularjs,angular4,Angularjs,Angular4,在Angular 2中一切都很好。然而,我升级到了4的beta版,在启动时出现了一个NoAnnotationError。我还没有服务,还没有注射 这是我的密码: app.ts import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { AppModule } from './app.module'; platformBrowserDynamic().bootstrapModule(A

在Angular 2中一切都很好。然而,我升级到了4的beta版,在启动时出现了一个NoAnnotationError。我还没有服务,还没有注射

这是我的密码:

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 ()
  {

  }
}
这是非常简单的东西。。。我不确定我在这里可能没有注释什么

下面是全部错误:

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.

我很笨。我使用的是Angular 4的测试版。没有一个发行候选。升级到rc2修复了此问题。

请查看文档…,ups Angular4没有。=)猜猜看。。。当您迁移到NG4时,您是否在package.json中更新了它所依赖的所有其他内容?比如,最新版本的打字脚本?
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.