【发布时间】:2018-03-05 18:26:37
【问题描述】:
我的 Angular.io 或 IONIC 中有一个对象
{name:"food panda", city:"selangor", phone:"0123456789"}
并使用以下代码,但它不起作用:
this.restaurant.name.toUpperCase();
我需要将food panda 转换为FOOD PANDA。
我该怎么做?
【问题讨论】:
-
toUpperCase()不会改变原始文件。您需要将其保存回来:this.restaurant.name = this.restaurant.name.toUpperCase();
标签: javascript angular ionic-framework