大佬教程收集整理的这篇文章主要介绍了Angular 2 Error在静态解析符号值时遇到错误,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
import {NgModulE} from "@angular/core"; import {TranslatePipE} from "./translate.pipe"; import {TRANSLATION_PROVIDERS} from "./translations"; import {TranslateservicE} from "./translate.service"; @NgModule({ declarations: [ TranslatePipe ],providers: [ TRANSLATION_PROVIDERS,Translateservice ],exports: [ TranslatePipe ] }) export class TranslateModule { }
而翻译.ts
import {OpaqueToken} from '@angular/core'; // import translations import {LANG_EN_US_NAME,LANG_EN_US_TRANS} from './lang-en_US'; import {LANG_DE_DE_NAME,LANG_DE_DE_TRANS} from './lang-de_DE'; // translation token export const TRANSLATIONS = new OpaqueToken('translations'); // default language export const DEFAULT_LANG = "en_US"; // all translations export const Dictionary = { [LANG_EN_US_NAME]: LANG_EN_US_TRANS,[LANG_DE_DE_NAME]: LANG_DE_DE_TRANS }; // providers export const TRANSLATION_PROVIDERS = [ {provide: TRANSLATIONS,useValue: Dictionary} ];
以上是大佬教程为你收集整理的Angular 2 Error在静态解析符号值时遇到错误全部内容,希望文章能够帮你解决Angular 2 Error在静态解析符号值时遇到错误所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。