【发布时间】:2019-02-05 20:18:32
【问题描述】:
我需要将以下所有这些数据声明到一个单独的常量文件中,并在 ts/controller 文件之一中使用它
this.flags = {};
this.flags['NL'] = "flag-icon flag-icon-nl";
this.flags['BE'] = "flag-icon flag-icon-be";
this.flags['DE'] = "flag-icon flag-icon-de";
this.flags['FR'] = "flag-icon flag-icon-fr";
this.flags['SE'] = "flag-icon flag-icon-se";
this.flags['ES'] = "flag-icon flag-icon-es";
if(this.routingConfiguratioService.countryCode==='BE'){
this.labels["ILB"] = "Athlon Car Lease";
this.labels["DAL"] = "Belfius Auto Lease NV";
this.labels["C4P"] = "Cars4Publicity BVBA";
} else if(this.routingConfiguratioService.countryCode==='LU'){
this.labels["LUX"] = "Athlon Car Lease Lux";
} else{
this.labels["ACL"] = "Athlon Car Lease";
this.labels["WPL"] = "Wagenplan";
}
【问题讨论】:
-
请检查下面的答案,这将解决您的问题
-
This answer 可能会有所帮助
标签: angular