-
Notifications
You must be signed in to change notification settings - Fork 149
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
Using Font Awesome 5 in Angular application before bootstrapping (and after bootstrapping) #15
Comments
@wartab this is an interesting optimization. One way that you might be able to accomplish this is with server-side rendering. What creates the HTML page that triggers your Angular bootstrapping? |
As a quick solution I would consider inlining SVG icon with any relevant CSS styles in Wonder why https://fontawesome.com/how-to-use/use-with-node-js didn't work for you. Is there any specific problem? It should essentially return SVG icon as a string and than you will need to attach it to DOM. And probably add FA CSS as well. |
@robmadole My Angular application is encapsulated in Electron, I do serve the HTML file as produced after a normal build with Angular-CLI. There's no server-side rendering involved. @devoto13 I guess that this could be a temporary solution that works. Hopefully something better can be found, though. |
Thank you, that seems to work fine! This works: https://pastebin.com/QJKMNBUu By the way, deep imports need to be done this way for me and work everywhere: Not sure if that is what you meant in your Stackblitz in the comment after the import. |
Yes, it is unexpected. Not sure why it happens though.
Yes, this is exactly what my comment was about. |
@wartab I looked into why it does not work without In any case above approach is rather a convenient workaround than a proper way to handle this case. The main drawback is that users will still see empty screen while browser loads and parses The proper way to do this would be to inline loading spinner in the
|
Yes, I have noticed this issue with a blank page for a short time. For now, we'll stick with the easiest solution, which is roughly your first solution. Thank you very much for your help on this issue. |
There might be a connection between this issue and #18. |
We have been using Font Awesome 4 up until now and are now in the process to upgrade to version 5 properly.
All icons are working perfectly and this package seems to accomplish everything we have used so far in version 4 while being easy to use.
There is sadly one issue we are unable to solve: we would like to use a spinning circle-notch icon before Angular is done bootstrapping our application.
With Font Awesome 4, we would just add font-awesome's CSS files to
.angular-cli.json
and add<i class="fa fa-circle-o-notch fa-spin fa-3x fa-fw"></i>
to the HTML file.This approach doesn't work, not even if importing the icons in
main.ts
without angular-fontawesome as described here: https://fontawesome.com/how-to-use/use-with-node-jsIs there a recommended way to achieve the same behavior?
The text was updated successfully, but these errors were encountered: