using paper datatable in angular2

前端 未结 2 1920
时光取名叫无心
时光取名叫无心 2020-12-20 04:30

I have been struggling for quiet a while about using paper-data-table (paper data table by David Mulder) in my angular 2 application.

The problem im facing is descri

相关标签:
2条回答
  • 2020-12-20 04:53

    <template> elements are processed by Angular internally and never actually land in the DOM.

    Some suggestions

    • ensure you have shadow DOM enabled for Polymer and full polyfills loaded for browsers without native shadow DOM support. See also https://www.polymer-project.org/1.0/docs/devguide/settings.html

    • you could wrap the element that provides the <template> and the data-table element inside another Polymer element, so that Angular doesn't process the <template> element because it's part of a Polymer element instead of a Angular view.

    • you could try to add the template element imperatively to the DOM to circument Angulars template processing

    See also this issue I reported recently https://github.com/angular/angular/issues/7974

    0 讨论(0)
  • 2020-12-20 04:59

    I think I managed to get to some solution. I altered small parts of the source code, this might "hurt" some features (I think only the ones related to the column array) but I work with it in my project and it works great. I also wrote a small angular 2 component wrapper to ease things up.

    You can check it out here:

    paper-datatable-fixes-for-angular-2

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