Material design component “is not a known element” in Angular2

后端 未结 2 1873
青春惊慌失措
青春惊慌失措 2021-01-01 08:51

I have a hybrid Angular1 and Angular2 application. In one of the Angular2 components that I route to, I want to use a Material Design Button.

When I insert a button

2条回答
  •  旧时难觅i
    2021-01-01 09:29

    Sometimes when you add new component to the angular2 it does't directly register the tag in such cases you have to do 2 things:

    Go to app.component.ts file

    • 1) Insert manually in "import {component}" the button you want to add
    • 2) In the @Component register your component and give the path

提交回复
热议问题