typescript @-annotation error

Question!

I try to use the @-annotations in visualstudio in a typescript-file with angular 2.

But when I enter

import {Component, View, bootstrap, formDirectives} from "angular2/angular2";

@Component({

    selector: "tko-app"
})
@View({
    directives: [formDirectives],
    templateUrl: "mainapp.html"
});
class MainApp
.....

visualstudio 2015 shows me an error that @... is unexpected. When remove the @ form the component there is no error and I get intellisense for Component and View...

Visual Studio Code is not complaining about that.

enter image description here



Answers

visualstudio 2015 shows me an error that @... is unexpected

Install TypeScript 1.5 for VS 2015. Follow the tools link : http://www.typescriptlang.org/

By : basarat


This video can help you solving your question :)
By: admin