javascript - Unable to bootstrap angular 2 app -
i'm working on app in angular 2/ nodejs , i'm trying bootstrap application. i've defined root component in app.component.ts:
import {component} 'angular2/core'; @component({ selector: 'pm-app', template:`<div><h1>{{pagetitle}}</h1> <div>my first component</div> <div>` }) export /** * name */ class appcomponent { //constructor(parameters) {} pagetitle: string = "acme product managment"; }
and when app loads, page title should injected index.html page in <pm-app>
tag:
(index.html)
<html> <head> <title>angular 2 quickstart</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link href= "node_modules/bootstrap/dist/css/bootstrap.css" rel= "stylesheet" /> <link rel="app/app.component.css" href="styles.css"> <!-- 1. load libraries --> <script src="node_modules/angular2/es6/dev/src/testing/shims_for_ie.js"></script> <script src="node_modules/es6-shim/es6-shim.min.js"></script> <script src="node_modules/systemjs/dist/system-polyfills.js"></script> <!-- polyfill(s) older browsers --> <script src= "node_modules/angular2/bundles/angular2-polyfills.js"></script> <script src="node_modules/systemjs/dist/system.src.js"></script> <script src= "node_modules/rxjs/bundles/rx.js"></script> <script src="node_modules/angular2/bundles/angular2.dev.js"></script> <!-- 2. configure systemjs --> <script src="systemjs.config.js"></script> <script> system.config({ packages:{ app:{ format: 'register', defaultextension: 'js' } } }); system.import('app/main').then(null, console.error.bind(console)); </script> </head> <!-- 3. display application --> <body> <pm-app>loading app</pm-app> </body> </html>
for reason, when page renders, "loading app" text shows think indicates bootstrapping process wasn't successful. when open dev console, following errors:
shims_for_ie.js:2 uncaught syntaxerror: unexpected token < es6-shim.min.js:2 uncaught syntaxerror: unexpected token < system-polyfills.js:2 uncaught syntaxerror: unexpected token < angular2-polyfills.js:2 uncaught syntaxerror: unexpected token < system.src.js:2 uncaught syntaxerror: unexpected token < rx.js:2 uncaught syntaxerror: unexpected token < angular2.dev.js:2 uncaught syntaxerror: unexpected token < systemjs.config.js:2 uncaught syntaxerror: unexpected token < localhost/:23 uncaught referenceerror: system not defined
all of these packages should installed problem?
Comments
Post a Comment