angular2 智能表未显示该表。我已经按照链接git hub
app.module.ts
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';
import { AppComponent } from './app.component';
import { Ng2SmartTableModule } from 'ng2-smart-table';
@NgModule({
imports: [BrowserModule, FormsModule, Ng2SmartTableModule],
declarations: [AppComponent],
bootstrap: [AppComponent]
})
export class AppModule { }
request.component.ts
import { Component } from '@angular/core';
import { ItableValues } from './tableValues.component';
import { RequestFilterPipe } from './request-filter.pipe';
import { TableService } from './table-service.component';
@Component({
selector: 'mm-request',
templateUrl: 'app/dataManagement/request.component.html',
})
export class RequestComponent {
pageTitle: string = 'Request';
imageWidth: number = 50;
imageMargin: number = 2;
settings = {
columns: {
id: {
title: 'ID'
},
name: {
title: 'Full Name'
},
username: {
title: 'User Name'
},
email: {
title: 'Email'
}
}
};
data = [
{
id: 1,
name: "Leanne Graham",
username: "Bret",
email: "Sincere@april.biz"
},
{
id: 2,
name: "Ervin Howell",
username: "Antonette",
email: "Shanna@melissa.tv"
},
// ... list of items
{
id: 11,
name: "Nicholas DuBuque",
username: "Nicholas.Stanton",
email: "Rey.Padberg@rosamond.biz"
}
];
}
request.component.html
<div>
<ng2-smart-table [settings]="settings" [source]="data"></ng2-smart-table>
</div>
每当我运行应用程序时,它只显示第一个加载页面。 所有帮助将不胜感激。
更新:我已经删除了声明和引导程序中使用的 Ng2SmartTableModule 。它用于测试。请查看控制台日志和错误 main.js 文件。
加载http://localhost:53869/app/main.js 时出错
"use strict";
var app_module_1 = require('./app.module');
var platform_browser_dynamic_1 = require('@angular/platform-browser-dynamic');
platform_browser_dynamic_1.platformBrowserDynamic().bootstrapModule(app_module_1.AppModule);
//# sourceMappingURL=main.js.map