【问题标题】:How to embed a local HTML page in Ionic 2?如何在 Ionic 2 中嵌入本地 HTML 页面?
【发布时间】:2017-08-23 08:52:24
【问题描述】:

我想将本地 html 文件嵌入到 Ionic 页面。 如何将这些带有 html 标记的本地文件嵌入或导入或插入到 Ionic 2 页面?

【问题讨论】:

标签: angular ionic2


【解决方案1】:

在 stackoverflow 和其他网站上搜索后,有很多不同的方法可以将 html 文件加载到 ionic 页面。最简单的方法是使用$http.get 方法获取页面并使用角度绑定绑定到页面。

this.http
  .get('something.../test.html')
  .map(response => response.text())
  .subscribe(html => binding_data = html);

如您所知,此方法对您的 ionic 页面有后门...

【讨论】:

    猜你喜欢
    • 2011-04-15
    • 2018-01-24
    • 2015-07-16
    • 1970-01-01
    • 2019-05-13
    • 2019-02-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多