I really want to use materializecss in Angular2.
I followed the steps from
https://www.npmjs.com/package/angular2-materialize.
I'm still studying Angular2 and using angular-cli. But I don't know where to add the plugin bec.
I don't know where webpack is. And I tried to follow this steps too https://medium.com/@ladyleet/using-materializecss-with-your-angular-2-angular-cli-app-2eb64b05a1d2#.cpgjvvo7m
but I don't know where angular-cli-build.js is?
oh, btw I am using angular-cli. I hope there's someone who can help me.
I really like materializecss. I'm always using it when I'm using AngularJS.
Thanks.
Answer from this repo : https://github.com/stanleyeosakul/angular-travelville
yarn add materialize-css@next ( or npm i materialize-css@next)Add Materialize CSS into .angular-cli.json ( or angular.json)
json
    // .angular-cli.json
    {
      "apps": [
        {
          ...
          "styles": [
            "../node_modules/materialize-css/dist/css/materialize.min.css",
            "styles.css"
          ],
          "scripts": [
            "../node_modules/materialize-css/dist/js/materialize.min.js"
          ],
          ...
        }
      ]
    }
Declare the M variable in ./src/typings.d.ts (or create the file yourself)
typescript
declare var M;
Materialize CSS is now integrated into Angular!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With