如何使内离子含量SVG [英] How to render svg inside ion-content

查看:150
本文介绍了如何使内离子含量SVG的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序正在使用Angularjs和离子建成,用科尔多瓦混​​合动力移动应用程序,试图渲染后端,从收到的SVG内容时,应用程序无法预期的渲染图。

My application is built using Angularjs and ionic, using cordova for hybrid mobile application, when trying to render svg content received from backend, application is unable to render expected diagram.

这是我的code的样子

This is how my code looks like

<ion-tab title="Diagram" icon-on="mcfly">           
        <ion-view>
            <ion-content class="padding" ng-class="{'has-loading': header.isLoading}">
                <h4>System Diagram</h4>                 
                    {{diagram}}
        </ion-content>
    </ion-view>
</ion-tab>

但我看到的是SVG数据,而不是形象,我错过任何声明或任何东西吗?

But what I see is svg data instead of image, am I missing any declaration or any thing ?

感谢

推荐答案

您需要把它在图像标签,就像这样:

You need to put it in image tag, like this:

<img class="title-image" src="path to your diagram" width="xxx" height="xxx" />

请检查该 plunker 显示SVG

这篇关于如何使内离子含量SVG的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆