This has been surprisingly hard to find an answer to, please point out if I'm not searching right and this is a duplicate question.
I have an Angular2 (2.0.0-beta.14) app and am having issues including a 3rd party css file. I've downloaded materialize-css via npm and I can see the file is at node_modules/materialize-css/bin/materialize.css
.
I would like this css file to be visible to my entire application.
At the highest level, I've tried including it in my index.html
head section <link rel="stylesheet" href="./node_modules/materialize-css/bin/materialize.css" media="screen">
, but can't figure out where it's being served or even if it's being served.
At a lower level, I've tried defining it in the styleUrls
token of the app initiation.
@Component({
selector: 'myApp',
providers: [],
pipes: [],
directives: [ROUTER_DIRECTIVES],
templateUrl: 'app/henna.html',
styleUrls: ['materialize.css']
})
I've tried various different styleUrls trying to find the file, but it seems the problem might be that the file is not accessible.
Please let me know any more info that is needed to help, this is my first application that I've used Angular2.
materialize-css
with no problems after cloningangular2-seed
. Have you made any structural changes to this seed? – Cosmin Ababei Apr 15 at 20:25npm install materialize-css
what did you do to have the css file loaded? – awwester Apr 15 at 21:25<link rel="stylesheet" href="./node_modules/materialize-css/bin/materialize.css" media="screen">
. What error are you getting? 404? – Cosmin Ababei Apr 15 at 21:53