Internationalization Angular2的NumericTextBox剑道用户界面,带有自定义IntlService
我为Angular2拍摄了剑道UI的最新RC0。它的文档提到了国际化服务的使用。我已经创建了自定义IntlService,并在我的应用程序模块中配置了它的提供程序。在组件中,如果我使用IntlService依赖项,则会调用我的自定义服务,但NumericTextBox不会调用我的服务。以下代码中有什么错误 MyIntlService.tsInternationalization Angular2的NumericTextBox剑道用户界面,带有自定义IntlService,internationalization,kendo-ui-angular2,Internationalization,Kendo Ui Angular2,我为Angular2拍摄了剑道UI的最新RC0。它的文档提到了国际化服务的使用。我已经创建了自定义IntlService,并在我的应用程序模块中配置了它的提供程序。在组件中,如果我使用IntlService依赖项,则会调用我的自定义服务,但NumericTextBox不会调用我的服务。以下代码中有什么错误 MyIntlService.ts import { CldrIntlService } from '@progress/kendo-angular-intl'; import { Inject
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 { }
应用程序组件
export class AppComponent {
constructor(private intl: IntlService) {
console.log( " From AppComponent " + intl.formatNumber(42, "c"));
}
}
您可以在中提交问题。请提供一个可运行的示例来演示该问题