Join the Stack Overflow Community
Stack Overflow is a community of 6.8 million programmers, just like you, helping each other.
Join them; it only takes a minute:
Sign up

I am getting an expected semi-colon error from TypeScript when trying to compile the following Angular component.

It seems fine to me but the error was only thrown when i added the this.$routeConfig array:

export class AppComponent implements ng.IComponentOptions {
    public template: string;
    public $routeConfig: Array<any>;
    constructor(){
        this.template = `<h1>Home</h1>
                        <ng-outlet></ng-outlet>`;
        this.$routeConfig: [{ 
            path: '/', 
            component: 'loginComponent', 
            name: 'Login', 
            useAsDefault: true
        }];
    }
}
share|improve this question
up vote 0 down vote accepted

Just realised my 'school boy' error!

Should be this.$routeConfig = [];

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.