首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >如何在html中插入字符串变量

如何在html中插入字符串变量
EN

Stack Overflow用户
提问于 2018-08-05 17:33:57
回答 1查看 160关注 0票数 0

我想在html中添加一个来自I/storage的字符串变量。

home.ts

export class HomePage {
  @ViewChild('username') uname;

  constructor(public navCtrl: NavController, public alertCtrl: AlertController, public strg: Storage) {

  }
  signIn() {
    this.strg.set('uname', this.uname.value);
    this.navCtrl.push(Page1Page);
  }
}

page1.html

<ion-content padding>
<p>Welcome to this app, /**I want to add the uname here**/ </p>
</ion-content>

我该如何使用page1.ts从I/storage中分配字符串呢?

EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51693113

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档