Hi, I have been trying to play around with angular2 lately but I have been
jumping into an issue which is preventing me from moving.
Issue:
I am using grunt to compile my .ts files into .js is this is my config:
emitDecoratorMetadata: true,
experimentalDecorators: true,
module: "system",
target: "es5"
In my app.j file, I am trying to load an external component i defined
called NavBar like so:
app.ts
import {
Component,
View,
bootstrap
} from "angular2/angular2";
import {NavBar} from "./components/navbar/navbar";
@Component({
selector: 'app'
})
@View({
directives: [NavBar],
template: `
<navbar></navbar>
<div>Hello world</div>
`
})
export class App{
}
bootstrap(App)
components/navbar/navbar.ts
import {
Component,
View,
} from "angular2/angular2";
@Component({
selector: 'navbar'
})
@View({
template: `
<div>Navbar</div>
`
})
export class NavBar {
}
When I load the app in the browser i get the following error.
Uncaught SyntaxError: Unexpected token < navbar:1
Uncaught SyntaxError: Unexpected token < angular2.dev.js:138
Evaluating http://localhost:8000/components/navbar/navbar
Error loading http://localhost:8000/app.js
What am I doing wrong?
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.