This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///<reference path="../../../typings/angularjs/angular-mocks.d.ts"/> | |
import {ObservableRequestService} from '../../../src/core/observable-request-service.ts'; | |
import { | |
Http, | |
ConnectionBackend, | |
BaseRequestOptions, | |
MockBackend, | |
ResponseOptions, | |
Response | |
} from 'angular2/http'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <reference path='../../typings/angularjs/angular.d.ts' /> | |
//TODO - a temp fix is using jquery ajax until angular2/http adds support for withCredentials on their xhr objects | |
import {Http, Headers} from 'angular2/http'; | |
import {Injectable, Observable} from 'angular2/core'; | |
@Injectable() | |
export class ObservableRequestService { | |
constructor(private http:Http) { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {EventEmitter} from 'angular2/angular2'; | |
class Dispatcher { | |
subjects = {}; | |
constructor() { | |
} | |
emit(topic, data = null) { | |
this.getInstance(topic).next(data); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//could also be a non recursive function etc | |
function factorial(n) { | |
return (n < 2) ? 1 : factorial(n-1) * n; | |
} | |
function getElementAtPosition(n, k) { | |
return factorial(n) / (factorial(k) / factorial(n-k)); | |
} | |
function pascalRow(n) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
System.transpiler = 'typescript'; | |
System.meta['typescript'] = {format: 'global', exports: 'ts'}; | |
System.paths = { | |
'*': '*.ts', | |
'typescript': 'node_modules/typescript/lib/typescript.js' | |
}; | |
System.import('/src/main.ts'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var width = 960, | |
height = 500; | |
var clip = d3.geo.clipExtent() | |
.extent([ | |
[0, 0], | |
[width, height] | |
]); | |
var canvas = d3.select("body").append("canvas") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?2.4.6"></script> | |
<link href='http://mbostock.github.com/d3/ex/force.css' rel='stylesheet' type='text/css'/> | |
<script src='http://mbostock.github.com/d3/d3.layout.js?2.4.6' type='text/javascript'></script> | |
<script src='http://mbostock.github.com/d3/d3.geom.js?2.4.6' type='text/javascript'></script> | |
<script src="http://axc.net/code_libraries/lasso/lasso.min.js"></script> | |
<style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @ngdoc object | |
* @name ng.$routeProvider | |
* @function | |
* | |
* @example | |
* add this to the App | |
* App.provider('$route', App.Lib.RouteProviderRegex); | |
* | |
* And |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*jshint bitwise:true, camelcase:true, curly:true, eqeqeq:true, forin:true, latedef:true, newcap:true, noarg:true, | |
noempty:true, nonew:true, undef:true, unused:true, strict:true, browser:true, camelcase:false */ | |
/*globals | |
$: false | |
*/ | |
/*exported | |
ToolTipDirective | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*jshint bitwise:true, camelcase:true, curly:true, eqeqeq:true, forin:true, latedef:true, newcap:true, noarg:true, | |
noempty:true, nonew:true, undef:true, unused:true, strict:true, browser:true, camelcase:false */ | |
/*globals | |
$: false | |
*/ | |
/*exported | |
SortableDirective | |
*/ |