Materialize and Slider in Angular2

0

Alright? Now the doubt is for those who are used to using materialize, more precisely the Slider component that has in the Javascript / Media menu. It does not start. I installed the angular2-materialize following all the steps for the installation with angular-cli. Even then I still had to comment on // import "materialize-css"; in main.ts and no use adding the lines

<link type="text/css" rel="stylesheet" href="vendor/materialize-css/dist/css/materialize.css"/>
<script type="text/javascript" src="vendor/jquery/dist/jquery.min.js"></script>

That gives 404 error. Has anyone managed to resolve these issues?

Hugs

    
asked by anonymous 01.12.2016 / 00:34

1 answer

1

In the angular cli do not add the style to the index, you have to go to the angular-cli.json file and in:

"styles": ["../node_modules/materialize-css/dist/css/materialize.css"] 

and no scripts:

    "scripts": [
  "../node_modules/jquery/dist/jquery.js",
  "../node_modules/materialize-css/dist/js/materialize.js"
],

Do not forget to install by npm: npm i angular2-materialize

    
29.12.2016 / 17:44