How to integrate a material components website with an Angular CLI project?

I follow the Getting Started instructions for adding Materials for websites, and in step 4 I get the following error:

<script>mdc.autoInit()</script>
-> Uncaught ReferenceError: mdc is not defined at (index):17

As already mentioned, this is an Angular CLI project, so the script is loaded from a file .angular-cli.json:

"scripts": [
    "../node_modules/material-components-web/dist/material-components-web.js"
]

Is there any other place in CLI setup, should I upload a file or make a call mdc.autoInit()?

I also reviewed Angular 2 Framework Integration , and this did not help. It does not use the CLI, and it never calls mdc.autoInit().

+4
source share
1 answer

index.html. .

-1

Source: https://habr.com/ru/post/1679152/


All Articles