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
function injector(type:string, name:string, values:string[]):any { | |
return (target:Function) => { | |
const injectee:Function = (...args:any[]):Object => { | |
return ((classConstructor:Function, args:any[], ctor:any):Object => { | |
ctor.prototype = classConstructor.prototype; | |
const child:Object = new ctor; | |
const result:Object = classConstructor.apply(child, args); | |
return typeof result === "object" ? result : child; | |
})(target, args, () => { | |
return null; |
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
type BindingType = '<' | '@' | '&' | '='; | |
interface Bindings { | |
[property:string]:BindingType | |
} | |
export interface IComponentDefinitionObject { | |
bindings?:Bindings; | |
controllerAs?:string; | |
require?; |
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
app.directive('bindTo', function($compile) { | |
return { | |
scope:false, | |
restruct:'A', | |
terminal:true, | |
priority: 1000, | |
compile: function(tElem) { | |
tElem.removeAttr('bind-to'); | |
return function (scope, elem,a) { | |
var context = a.bindContext; |
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
interface someDataType { | |
} | |
export interface IParentComponentConroller { | |
getSomeData():ng.IPromise<someDataType); | |
} | |
class ParentComponentConroller implements IParentComponentConroller { | |
constructor(private $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
/** | |
* Adds a custom menu with items to show the sidebar and dialog. | |
* | |
* @param {Object} e The event parameter for a simple onOpen trigger. | |
*/ | |
function onOpen(e) { | |
SpreadsheetApp.getUi() | |
.createAddonMenu() | |
.addItem('Add Quotes', 'addQuotes') | |
.addToUi(); |
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
function setupHooks(controller) { | |
controller.prototype.deactivate = ['$scope',function($scope) { | |
console.log("deactivating",$scope); | |
}]; | |
controller.prototype.canActivate = ['routeTransitions','$timeout',function(routeTransitions,$timeout) { | |
console.log("activating",routeTransitions.sourceElement); | |
var source = routeTransitions.sourceElement; | |
if (source) { | |
routeTransitions.sourceElement = null; | |
var cloneE = source[0].cloneNode(true); |
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
@Decorator(selector:'[sample]') | |
class Sample implements AttachAware{ | |
Element _element; | |
Http _http; | |
Sample(this._element, this._http); | |
var sanitizer = const HtmlEscape(); | |
Future<String> getFromDOM(String id) { | |
var sample = document.querySelector(id); |
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 es = require('event-stream'); | |
var ngDep = require('ng-dependencies'); | |
var toposort = require('toposort'); | |
var ANGULAR_MODULE = 'ng'; | |
module.exports = function angularFilesort (bundleFilter) { | |
var files = []; | |
var angmods = {}; | |
var toSort = []; |
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
'use strict'; | |
app | |
.directive('twfTransferToScope', function () { | |
return { | |
restrict: 'E', | |
link: function (scope, element, attr) { | |
element.hide(); | |
scope[attr.name] = angular.fromJson(element.text()); | |
} |
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 fs = require('fs'); | |
var cheerio = require('cheerio'); | |
var Chance = require('chance'); | |
var chance = new Chance(); | |
function getRandomData(type, hint) { | |
if (type == 'number') { | |
return (Math.random() * 1000000 | 0) / 100; | |
} else if (type == 'boolean') { | |
return Math.random() >= 0.5; |