I am currently in the process of restructuring a Component, which originally linked stylesheets in its HTML template but I want to switch to using styleUrls instead.
The original template contained an include similar to this:
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
After the refactor, it now looks like this:
styleUrls: [
'https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css'
],
encapsulation: ViewEncapsulation.None
The stylesheet is loading successfully, however, it is being loaded as an inline style rather than through the link tag. This means references like:
src:url('../fonts/fontawesome-webfont.eot?v=4.4.0');
Are not pointing to:
https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/fonts/fontawesome-webfont.eot?v=4.4.0
Instead, they should be pointing to:
http://localhost:9000/fonts/fontawesome-webfont.eot?v=4.4.0
I'm unsure how to proceed with refactoring the HTML template to use styleUrls while preserving the relative references. Any advice would be greatly appreciated!