2016-05-16 63 views
0

我在尝试编译以下Angular组件时从TypeScript获得预期的分号错误。Typescript编译器错误预期分号与Angular 1.5组件

这似乎没什么问题,但是当我加入this.$routeConfig阵列只抛出的错误:

export class AppComponent implements ng.IComponentOptions { 
    public template: string; 
    public $routeConfig: Array<any>; 
    constructor(){ 
     this.template = `<h1>Home</h1> 
         <ng-outlet></ng-outlet>`; 
     this.$routeConfig: [{ 
      path: '/', 
      component: 'loginComponent', 
      name: 'Login', 
      useAsDefault: true 
     }]; 
    } 
} 

回答

0

刚刚意识到我的“高中男生”的错误!

应该是this.$routeConfig = [];