Ich habe ein Upgrade auf die Winkel 2 Final Release von RC 4 und erhalte ich den Fehler (?): (SystemJS) Can't resolve all parameters for ElementRef: (?)
Angular 2 Mitteilung (SystemJS) Es können nicht alle Parameter für ElementRef beheben:
Diese meine app ist. module.ts Code:
import { NgModule, ElementRef } from '@angular/core';
import {FormsModule} from '@angular/forms';
import { HttpModule, JsonpModule } from '@angular/http';
import { BrowserModule } from '@angular/platform-browser';
import {DashboardModule} from '../../areas/dashboard/dashboard.module';
import {AppComponent} from '../../areas/dashboard/app.component';
import { NgGridModule } from 'angular2-grid';
@NgModule({
declarations: [AppComponent],
imports: [BrowserModule, HttpModule, FormsModule, DashboardModule, NgGridModule],
bootstrap: [AppComponent],
providers: [ElementRef]
})
export class AppModule {}
ich kann nicht einfach importieren die Komponentenebene tat, weil ich auch Plugins bin, die auf sie verlassen (zum Beispiel angular2-grid)
irgendwelche Ideen?
danken Sie im Voraus
EDIT:
Hier ist ein Code mit einem Aufruf an ngGrid drin:
<div [attr.ngGrid]="gridConfig" (onItemChange)="onGridItemChange($event)">
<div *ngFor="let Widget of Widgets" class="gridWidget" [class.showingGridView]="Widget.gridview.show" [(attr.ngGridItem)]="Widget.widget" id="widget_{{Widget.id}}">
<div class="title handle"></div>
<h5 class="grid-item-title">{{Widget.title}}</h5>
<a *ngIf="Widget.gridview.show && (Widget.chart.data || Widget.chart.datasets)" class="backLink" title="Back to Chart" (click)="toggleGridView($event)" href="" id="{{Widget.id}}"><i class="fa fa-undo"></i></a>
<a (click)="removeWidgetFromBoard($event)" href="" class="removeLink" id="removeWidgetLink_{{Widget.id}}" title="Remove Widget from Dashboard"><i class="fa fa-trash"></i></a>
<base-chart *ngIf="!Widget.gridview.show" class="chart" id="chart_{{Widget.id}}"
[attr.data]="Widget.chart.data"
[attr.datasets]="Widget.chart.datasets"
[attr.labels]="Widget.chart.labels"
[attr.options]="Widget.chart.options"
[attr.legend]="Widget.chart.legend"
[attr.chartType]="Widget.chart.chartType"
(chartClick)="chartClicked($event)"></base-chart>
<iwe-datatable *ngIf="Widget.gridview.show" id="data-table"
attr.table_title="{{Widget.title}}"
attr.table_summary="A table with data for {{Widget.title}}."
attr.border_type="vertical"
attr.table_content="{{Widget.gridview.tableData}}">
</iwe-datatable>
<img class="smallSpinner" [ngClass]="{visible: Widget.showSpinner}" src="/iwe/img/BG_Spinner_32.gif" alt="Small Spinner" width="34" height="34">
</div>
</div>
Warum übergeben Sie 'ElementRef' als Provider in Ihrem Modul? – yurzui
Ich fing an, es dort zu übergeben, weil, wenn ich nicht tue, erhalte ich einen Fehler, der "keinen Versorger für elementref" sagt – blubberbo
Wo benutzt du 'ElementRef'? – yurzui