2017-01-20 3 views
0

Angular2 용 검도 UI의 최신 RC0을 가져 왔습니다. 문서에는 국제화 서비스 사용에 대한 언급이 있습니다. 사용자 지정 IntlService를 만들고이를 내 App Module에 공급자로 구성했습니다. 구성 요소에서 IntlService 종속성을 사용하면 사용자 정의 서비스가 호출되지만 NumericTextBox가 내 서비스를 호출하지 않습니다. 다음 코드에서 잘못된 점은 무엇입니까?NumericTextBox 사용자 정의 IntlService로 Angular2 용 검도 UI

MyIntlService.ts

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; 
     } 
} 

당신은 GitHub repository ↗에 문제를 제기 할 수 있습니다

@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

을 app.module.ts. 문제를 보여주는 실행 가능한 예제를 제공하면 감사하겠습니다.