Skip to content

Instantly share code, notes, and snippets.

View consoledotblog's full-sized avatar

consoledotblog

View GitHub Profile
@consoledotblog
consoledotblog / bawts-02.js
Last active January 14, 2016 17:14 — forked from Nijhazer/bawts-02.js
Building Applications with TypeScript - Snippet 02
var myTask = TaskManager.getTask(1);
@consoledotblog
consoledotblog / bawts-03.js
Created January 14, 2016 17:14 — forked from Nijhazer/bawts-03.js
Building Applications with TypeScript - Snippet 03
var myTask = TaskManager.getTask("1");
@consoledotblog
consoledotblog / bawts-04.js
Created January 14, 2016 17:14 — forked from Nijhazer/bawts-04.js
Building Applications with TypeScript - Snippet 04
var TaskManager = {
getTask: function(id) {
id = parseInt(id);
// issue an API request to fetch this task
}
};
@consoledotblog
consoledotblog / bawts-05.js
Created January 14, 2016 17:14 — forked from Nijhazer/bawts-05.js
Building Applications with TypeScript - Snippet 05
var TaskManager = {
getTask: function(id: number) {
// issue an API request to fetch this task
}
};
@consoledotblog
consoledotblog / bawts-06.js
Created January 14, 2016 17:14 — forked from Nijhazer/bawts-06.js
Building Applications with TypeScript - Snippet 06
APIManager.configure({
baseURL: 'http://localhost'
});
@consoledotblog
consoledotblog / bawts-07.js
Created January 14, 2016 17:15 — forked from Nijhazer/bawts-07.js
Building Applications with TypeScript - Snippet 07
interface IAPIConfiguration {
url: string;
}
var APIManager = {
configure: function(configuration : IAPIConfiguration) {
}
};
@consoledotblog
consoledotblog / bawts-08.js
Created January 14, 2016 17:15 — forked from Nijhazer/bawts-08.js
Building Applications with TypeScript - Snippet 08
export class Task {
public name: string;
public active: boolean;
public render() : string {
if (this.active) {
return '[Inactive] ' + this.name;
}
return this.name;
}
@consoledotblog
consoledotblog / bawts-09.sh
Created January 14, 2016 17:15 — forked from Nijhazer/bawts-09.sh
Building Applications with TypeScript - Snippet 09
tsc --module commonjs task.ts
@consoledotblog
consoledotblog / bawts-10.sh
Created January 14, 2016 17:15 — forked from Nijhazer/bawts-10.sh
Building Applications with TypeScript - Snippet 08
tsc --module amd task.ts
@consoledotblog
consoledotblog / bawts-11.js
Created January 14, 2016 17:15 — forked from Nijhazer/bawts-11.js
Building Applications with TypeScript - Snippet 11
export interface IDataDriver {
getConnection() : Promise;
getRepository(repositoryName : string) : Promise;
getIdType(value : any) : any;
}