【问题标题】:How to import an individual local html file in angular4如何在angular4中导入单个本地html文件
【发布时间】:2017-11-16 09:23:07
【问题描述】:

有一个iframe:

<iframe></iframe>

另一个 js 将动态添加“src=xxx.html”到 iframe 标签中。 而xxx.html是一个本地文件,web控制台显示:

ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'xxx.html'

对于 angular4 项目,我应该将单个本地 html 文件放在哪个目录中?

【问题讨论】:

    标签: html angular iframe


    【解决方案1】:

    你的 xxx.html 文件在哪里?

    <iframe name="xxx" src="location your xxx.html files"></iframe>
    

    【讨论】:

    • 不行,js会自动设置iframe src,所以不能手动设置。
    猜你喜欢
    • 1970-01-01
    • 2020-07-24
    • 2020-01-30
    • 2020-03-02
    • 2017-03-14
    • 2012-02-03
    • 1970-01-01
    • 1970-01-01
    • 2021-09-24
    相关资源
    最近更新 更多