2017-01-20 2 views
0

私はAngular2用の剣道UIの最新RC0を採用しました。ドキュメントには国際化サービスの使用が記載されています。カスタムIntlServiceを作成し、それを私のApp Moduleに設定しました。コンポーネントでIntlServiceの依存関係を使用すると、カスタムサービスが呼び出されますが、NumericTextBoxはサービスを呼び出していません。次のコードで何が間違っていますか?NumericTextBoxカスタムIntlServiceを使用したAngular2の剣道

MyIntlService.tsあなたはGitHub repository ↗に問題を提出することができます

import { CldrIntlService } from '@progress/kendo-angular-intl'; 
import { Injectable } from '@angular/core'; 

@Injectable() 
export class MyIntlService extends CldrIntlService {   
     constructor() { 
      super("en-US"); 
      console.info('From MyIntlService ctor'); 
     } 
     formatNumber(value: number, format: string| NumberFormatOptions){ 
      const result = super.formatNumber(value,format); 
      console.log('In MyIntlService formatNumber'); 
      return result; 
     } 
} 

app.module.ts

@NgModule({ 
    imports:  [ BrowserModule, InputsModule ], 
    declarations: [ AppComponent ], 
    bootstrap: [ AppComponent ], 
    providers: [{ 
    provide: IntlService, 
    useClass: MyIntlService 
    }] 
}) 
export class AppModule { } 

app.component

export class AppComponent { 
    constructor(private intl: IntlService) { 
     console.log(" From AppComponent " + intl.formatNumber(42, "c")); 
    } 
} 

答えて

0

。この問題を実証する実行可能な例を提供することは高く評価されます。

関連する問題