0

私はWebアプリケーションでルーティングを処理するためにui-router-ng2を使用しています。 。 this.iconName = this.StateService.params.iconName;次のエラーがスローされます。:Property 'iconName' does not exist on type 'StateParams'.角型2 - エラー "プロパティ 'iconName'が型 'StateParams'に存在しません

それは私が必要とするかもしれ別の観点

は、ここでこれはラインであるicon.component.ts

import { Component } from '@angular/core'; 
import { StateService } from 'ui-router-ng2'; 

@Component({ 
    selector: 'icon', 
    templateUrl: 'icon.html', 
}) 
export class IconComponent { 
    StateService: StateService; 
    iconName: StateService; 


    constructor(stateService: StateService) { 
     this.StateService = stateService; 

     this.iconName = this.StateService.params.iconName; 
    } 
} 

ための私のコードですicoNameとassiを初期化するそれをparamsに渡しますか?私はこのエラーを解決するためにどうすればいいのか分かりません。

答えて

関連する問題