Skip to content
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

Angular 8 project with .svg template causes error #940

Closed
supdegrave opened this issue Apr 19, 2019 · 2 comments
Closed

Angular 8 project with .svg template causes error #940

supdegrave opened this issue Apr 19, 2019 · 2 comments

Comments

@supdegrave
Copy link

supdegrave commented Apr 19, 2019

As of Angular 8 beta 5, there is support for SVG files as component templates.

I'm trying to test this out on StackBlitz.com, but get the following error:

Import error, can't find file:
./app.component.svg

Repro steps:

  • Create a new Angular project on stackblitz.com
  • Upgrade angular dependencies to Angular 8 - see below for dependencies list
  • Open app.component.ts, and set templateUrl: "./app.component.svg",
  • Create app.component.svg, or rename app.component.html
  • Edit app.component.svg, adding simple SVG content:
<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
  <circle cx="50" cy="50" r="50"/>
</svg>

Expected: SVG template should be recognized
Actual: Error message listed above is displayed in app browser.

Dependencies to update (paste the following string into dependencies input field):

@angular/common@8.0.0-beta.13 @angular/compiler@8.0.0-beta.13 @angular/core@8.0.0-beta.13 @angular/forms@8.0.0-beta.13 @angular/platform-browser@8.0.0-beta.13 @angular/platform-browser-dynamic@8.0.0-beta.13 @angular/router@8.0.0-beta.13

Environment:
MacOS 10.14.3 (18D109)
Chrome 73.0.3683.103
https://stackblitz.com/edit/ng8-svg-template

SVG content in app.component.html renders as expected, so I can continue testing the use of data-bound SVG in Angular, but it seems that StackBlitz will want to support this functionality as intended.

For comparison, using .svg template files works on https://codesandbox.io/s/6lv2r28n4k

@santoshyadavdev
Copy link

this is working now. fixed in the angular demo as well.

@purplem1lk
Copy link
Contributor

Thank you for your patience - This issue has been resolved and will be closed accordingly. If this issue persists, feel free to tag me or ask to reopen this issue with screenshots of the error. Thank you! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants