Closed robertellis100 closed 8 years ago
In the app.component.ts (you have bootstrap in the main.ts, so is not neccessary to add it here too)
///<reference path="./../typings/browser/ambient/es6-shim/index.d.ts"/>
import {Component} from '@angular/core';
import {bootstrap} from '@angular/platform-browser-dynamic';
import {AppComponent} from 'ng2-easy-table/app/app.component';
import {ConfigService} from "./config-service";
@Component({
selector: 'app',
directives: [AppComponent],
providers: [ConfigService],
template: ` <h3> My use of ng2-easy-table </h3>
<ng2-table [configuration]="configuration"></ng2-table>
`
})
export class App {
constructor(private configuration:ConfigService) {}
}
index.html
<html>
<head>
<title>Angular 2 QuickStart</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="styles.css">
<!-- Polyfill(s) for older browsers -->
<script src="node_modules/es6-shim/es6-shim.min.js"></script>
<script src="node_modules/zone.js/dist/zone.js"></script>
<script src="node_modules/reflect-metadata/Reflect.js"></script>
<script src="node_modules/systemjs/dist/system.src.js"></script>
<script src="systemjs.config.js"></script>
<script>
System.import('app').catch(function(err){ console.error(err); });
</script>
</head>
<body>
<my-app>Loading...</my-app>
</body>
</html>
if still doesn't work (this is configuration I use in two another projects and work like a harm) could you add your node version. Will test it with given version.
The recommended changes have been made to the suggested files; however, an error still occurs.
-app/app.component.ts (removed 'bootstrap(App, [ConfigService]);' line from file
bootstrap(App, [ConfigService]);
-index.html (removed '' from file
<script>System.import('dist/app/index.component').catch(function (err) {
console.error(err); });</script>
Error:
Error: Error: XHR error (404 Not Found) loading http://localhost:3000/ng2-easy-table/app/app.component
at XMLHttpRequest.wrapFn [as _onreadystatechange] (http://localhost:3000/node_modules/zone.js/dist/zone.js:769:30)
at ZoneDelegate.invokeTask (http://localhost:3000/node_modules/zone.js/dist/zone.js:356:38)
at Zone.runTask (http://localhost:3000/node_modules/zone.js/dist/zone.js:256:48)
at XMLHttpRequest.ZoneTask.invoke (http://localhost:3000/node_modules/zone.js/dist/zone.js:423:34)
Error loading http://localhost:3000/ng2-easy-table/app/app.component as "ng2-easy-table/app/app.component" from http://localhost:3000/app/app.component.j
Changed the <my-app>
tag within index.html to <app>
to match selector 'app'.
See my repo
Error: Same error above continues.
Implementation was improved. Redundant files were removed. See myang2tableproj2 repo. Though the new repo (goal: to implement ng2-easy-table with Angular2 QuickStart) results in errors, they are not the same errors as this issue #28; therefore, this issue #28 is closed.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
(Project started 5/9/2016) Error:
Follow these six steps to create the same issue:
app.component.ts
config-service.ts
data.json
main.ts
index.html
systemsj.config.js