0
私はAngular2が初めてです。私の仕事は、プロジェクトをangular2 RC1から2.1に更新することです。 「デフォルト」修飾子のないクラス宣言は、古いでありませんでした名前角2の字形コンパイルエラー: 'default'修飾子のないクラス宣言には名前が必要です
を持っている必要があります
: 私は5から6への私のタイプのスクリプト・バージョンを更新し、私はコンパイルの問題を見ていますようにバージョン。
マイTSファイル:
import { Component, OnChanges, SimpleChange, OnInit, Input,NgModule } from '@angular/core'; import {IconComponent} from '../icon'; import { WizardPageComponent } from '../wizard'; import { StepState } from './step-state.enum'; @Component({ selector: 'step-of-the-wizard', templateUrl: 'step-of-the-wizard.component.html', styleUrls: [ 'step-of-the-wizard.component.scss'] }) @NgModule({ declarations:[ IconComponent ] }) export class implements OnChanges, OnInit { @Input() name:string; @Input() state:StepState = StepState.UNCOMPLETED; @Input() size:number = 30; @Input() vertical:boolean = false; public iconNameUncompleted:string = 'blank-check-box'; public colorOfIconUncompleted:string = 'grey'; public iconNameCompleted:string = 'check-box'; public colorOfIconCompleted:string = 'green'; public iconNameInActiveState:string = 'create-new-pencil-button'; public colorOfIconInActiveState:string = 'red'; @Input() isLast:boolean = false; @Input() isFirst:boolean = false; public associatedPage:WizardPageComponent; activeIcon:string = this.iconNameUncompleted activeColor:string = this.colorOfIconUncompleted; linkColor:string = this.colorOfIconUncompleted; ngOnChanges(changes){ if(changes.state instanceof SimpleChange){ switch(changes.state.currentValue){ case StepState.COMPLETED: this.activeIcon = this.iconNameCompleted; this.activeColor = this.colorOfIconCompleted; this.linkColor = this.colorOfIconCompleted; break; case StepState.UNCOMPLETED: this.activeIcon = this.iconNameUncompleted; this.activeColor = this.colorOfIconUncompleted; this.linkColor = this.colorOfIconUncompleted; break; case StepState.ACTIVE: this.activeIcon = this.iconNameInActiveState; this.activeColor = this.colorOfIconInActiveState; this.linkColor = this.colorOfIconUncompleted; break; default: this.activeIcon = this.iconNameUncompleted; this.activeColor = this.colorOfIconUncompleted; break; } } } ngOnInit() { if(window.matchMedia("(max-width:1000px)").matches){ this.size = 15; } } }
とは私がグーグルでそれを探してみましたが、多くの助けを得ることはありませんでした「@Component」宣言
でコンパイル・エラーが発生します。
マイのTSconfigファイル:
{ "compilerOptions": { "declaration": false, "emitDecoratorMetadata": true, "experimentalDecorators": true, "lib": ["es6", "dom"], "mapRoot": "./", "module": "es6", "moduleResolution": "node", "outDir": "../dist/out-tsc", "sourceMap": true, "target": "es5", "typeRoots": [ "../node_modules/@types" ] }
}
感謝。あなたのクラスに名前を付ける必要があります