Integrating Material Design Lite with Angular2

后端 未结 7 1492
再見小時候
再見小時候 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-27 14:07

    The ng2-webpack Demo project includes a simple ng2 CRUD application that uses vanilla MDL

    Steps:

    • npm install --save material-design-lite
    • import the entire library in src/vendor.js
    • or just the desired components
    • in src/style/app.scss, import the desired components:

    Issues:

    Issue - MDL augmented DOM effects are not applied:

    • consistently during state changes
    • during route changes

    Solution:

    ngAfterViewInit() {
        // Ensure material-design-lite effects are applied
        componentHandler.upgradeDom();
    }
    

    see Working with Material Design Lite for more details.

提交回复
热议问题