We are trying to start a new Angular project with Visual Studio 2015. We've created a new TypeScript project, and following an example we found we have put the followings in our index.html file:
<script src="https://rawgithub.com/systemjs/systemjs/0.19.6/dist/system.js"></script>
<script src="https://code.angularjs.org/2.0.0-beta.0/angular2-polyfills.js"></script>
<script src="https://code.angularjs.org/2.0.0-beta.0/Rx.js"></script>
<script src="https://code.angularjs.org/2.0.0-beta.0/angular2.dev.js"></script>
(sidenode - why do we need to many includes? what each means and why not have all of them in a single base file?)
our Angular app looks like this:
import {Component} from 'angular2/core';
@Component({
// Declare the tag name in index.html to where the component attaches
selector: 'hello-world',
// Location of the template for this component
templateUrl: 'app/hello_world.html'
})
export class HelloWorld {
// Declaring the variable for binding with initial value
yourName: string = '';
}
We wanted to add a type file for Angular from definitelytyped but it seems like it's empty (https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/angular2/angular2.d.ts). We also installed it from nuget (https://www.nuget.org/packages/angular2.TypeScript.DefinitelyTyped/) and got the same empty file - maybe it's not keeping up with Angular development?
Error TS1148 Cannot compile modules unless the '--module' flag is provided. Angular2TS_Test c:\Users\Ophir_O\documents\visual studio 2015\Projects\Angular2TS_Test\Angular2TS_Test\app\app.ts 3 Active
Error TS2307 Cannot find module 'angular2/core'. Angular2TS_Test c:\Users\Ophir_O\documents\visual studio 2015\Projects\Angular2TS_Test\Angular2TS_Test\app\app.ts 3 Active
Error Build: Argument of type '{ selector: string; templateUrl: string; }' is not assignable to parameter of type '{ selector: string; properties?: Object; hostListeners?: Object; injectables?: List<any>; lifecyc...'. Angular2TS_Test c:\users\ophir_o\documents\visual studio 2015\Projects\Angular2TS_Test\Angular2TS_Test\app\app.ts 9
Error Build: Experimental support for decorators is a feature that is subject to change in a future release. Specify '--experimentalDecorators' to remove this warning. Angular2TS_Test c:\users\ophir_o\documents\visual studio 2015\Projects\Angular2TS_Test\Angular2TS_Test\app\app.ts 12
Error TS1219 Experimental support for decorators is a feature that is subject to change in a future release. Specify '--experimentalDecorators' to remove this warning. Angular2TS_Test c:\Users\Ophir_O\documents\visual studio 2015\Projects\Angular2TS_Test\Angular2TS_Test\app\app.ts 12 Active
What is to correct current way to start an Angular project with TypeScript and VisualStudio? we couldn't find any up-to-date guide...