Integrating Material Design Lite with Angular2

后端 未结 7 1447
再見小時候
再見小時候 2020-11-27 13:56

I have a small problem in integrating a meterial design (http://www.getmdl.io/) in ng2 Can you please help me I will put it in points what I have done

  1. http://w
相关标签:
7条回答
  • 2020-11-27 14:28

    just import ElementRef and OnInit from the angular2/core and inject it to a constructor as so:

    constructor(@Inject(ElementRef) elementRef: ElementRef) {
        this.elementRef = elementRef;
    

    }

    then use an ngOnInit method and use the componentHandler.upgradeElement on any dynamically added tag you used.

    0 讨论(0)
提交回复
热议问题