我正在尝试在我的 angular2 应用程序中使用 vaadin 网格...根据此处的文档https://vaadin.com/download#elements我已经导入了 webcomponents-lite.min.js 、 vaadin-grid.html 和 vaadin 指令这个例子http://plnkr.co/edit/B9216vP7kDlDkN44kriB?p=preview ...我没有看到任何错误,我也没有看到网格...有人可以告诉我我错过了什么吗?这是我在 html 中的导入语句
<link rel="import" href="https://cdn.vaadin.com/vaadin-core-elements/latest/vaadin-grid/vaadin-grid.html">
<script src="http://polygit.org/polymer+:master/components/webcomponentsjs/webcomponents-lite.min.js"></script>
这是文档中的指令
import {Directive, ElementRef, Input, Output, EventEmitter} from '@angular/core';
const Polymer = (<any>window).Polymer;
@Directive({selector: 'vaadin-grid'})
export class VaadinGrid {
@Output('grid-ready') gridReady: EventEmitter<any> = new EventEmitter(false);
private grid: any;
constructor(el: ElementRef) {
if (!Polymer || !Polymer.isInstance(el.nativeElement)) {
console.error("vaadin-grid has not been registered yet, please remember to import vaadin-grid.html in your main HTML page.");
return;
}
this.grid = el.nativeElement;
}
ngAfterViewInit() {
// Configuration <table> might be placed in a wrong container.
// Let's move it in the light dom programmatically to fix that.
var localDomTable = this.grid.querySelector("table:not(.vaadin-grid)");
if (localDomTable) {
Polymer.dom(this.grid).appendChild(localDomTable);
}
this.grid.then(() => {
this.gridReady.emit(this.grid);
});
}
}
我需要添加更多内容以使 vaadin 网格在我的 angular2 应用程序中工作吗?有人请帮助我