As you know, Visual Studio 2015 was released last night. At the same time, Microsoft introduced the final version of TypeScript 1.5, incorporating it into the new Visual Studio. It can also be downloaded separately for previous versions of VS or installed using npm. Under the cut - a short list of what's interesting in the new release.// math.ts export function add(x, y) { return x + y } export function subtract(x, y) { return x – y } export default function multiply(x, y) { return x * y } // myFile.ts import {add, subtract} from "math"; import times from "math"; var result = times(add(2, 3), subtract(5, 3)); { "compilerOptions": { "module": "commonjs", "noImplicitAny": true, "removeComments": true, "preserveConstEnums": true, "out": "../../built/local/tsc.js", "sourceMap": true }, "files": [ "core.ts", "sys.ts", "types.ts", "scanner.ts" ] } import {Component, View, NgFor, bootstrap} from "angular2/angular2"; import {loadFile} from "audioFile"; import {displayAudioFile} from "displayAudio"; @Component({selector: 'file-list'}) @View({template: ` <select id="fileSelect" size="5"> <option *ng-for="#item of items; #i = index" [selected]="selected === item"(click)="updateSelection()">{{ item }}</option> </select>`, directives: [NgFor] }) class MyDisplay { items: string[]; constructor() { this.items = ["item1", "item2"]; } updateSelection() { … } } Source: https://habr.com/ru/post/263153/
All Articles