What am I doing wrong?
app.component.ts
import {Component} from 'angular2/core';
@Component({
selector: 'my-app',
template: `{{title}}`
})
export class App {
title = "Angular 2 beta";
constructor() { console.clear(); }
}
main.ts
import {bootstrap} from 'angular2/platform/browser';
import {AppComponent} from './app.component';
bootstrap(AppComponent);
The error is
EXCEPTION: TypeError: Cannot read property 'annotations' of undefined
The class name doesn't match what you are bootstrapping. I.e., instead of
export class App { ... }
use
export class AppComponent { ... }
Angular is trying to find the annotations
property of a class named AppComponent
, but that class doesn't exist, hence the error.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With