-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It's not display svg with angular,typescript #40
Comments
I have the same issue on Android, tns --version 5.0.3. |
@liam-nirvana: This works for me. No need to have a app.module.ts
app.component.html
And please make sure that your SVG files are copied to And, yes, I'm using a fork from @teammaestro aka @bradmartin because it seems to be more stable for me. |
@ikysylevych did you encounter a parse exception? I used both the original package and tried the fork, got the same thing using the sample svgs (nativescript.svg, spider.svg, etc.)
|
@Tyler-V I'm using plenty of quite simple svg files (icons mostly) and I didn't have any parse errors. However, I didn't try the sample svgs. And I remember that earlier I found some open issues in svg libraries that reported some parsing problems with more complex svg files. |
This is the only working solution I've found so far(both android and ios). It's important to follow steps mentioned above. |
I used it in my app.module.ts like this:
import { registerElement } from "nativescript-angular/element-registry"; registerElement("SvgImage", () => require("nativescript-svg").SVGImage);
and here is html:
<SvgImage src="~/static/avatar_default_chat.svg"></SvgImage>
Is any place I did wrong?
by the way , my tns --version is 5.0
Would u like tell me how to fix it, thanks very much.
The text was updated successfully, but these errors were encountered: