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

后端 未结 2 1856
青春惊慌失措
青春惊慌失措 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条回答
  • 2021-01-01 09:06

    It should be

    <button md-button>foo</button>   
    

    OR

    <button md-raised-button>foo</button>
    
    0 讨论(0)
  • 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
    0 讨论(0)
提交回复
热议问题