Materialize and Slider in Angular2

Asked

Viewed 256 times

0

all right? Now the question 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 to the installation with angular-cli. Still I had to comment on the "materialize-css" import//; in main.ts and it’s 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’s a 404 error. Someone has already solved these issues?

Hugs

1 answer

1


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

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

and in the 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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.