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
angular.module("test", []) | |
.controller("testCtrl", function($scope) { | |
$scope.value = ""; | |
}) | |
.directive('custSrc', function() { | |
return { | |
restrict: "A", | |
scope: { | |
value: "=custSrc" | |
}, |
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
class Person{ | |
private Name: string; | |
constructor(public Age: number, name: string){ | |
this.Name = name; | |
} | |
Older(){ | |
this.Age ++; | |
} | |
} |
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
module PowerLine { | |
export interface IValidatable { | |
Validate: (model: any, info: any) => boolean; | |
} | |
export class Validator implements IValidatable { | |
public Validate(info: any) { | |
var results = []; | |
for (var key in info) { | |
if(key !== "constructor" && typeof info[key] !== "function"){ |
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 getPage(page, list, amountPerPage) { | |
if (page > 0) { | |
var start = 0; | |
if (page !== 1) { | |
start = page; | |
start = start -1; | |
} | |
if (list.length > 0) { | |
return angular.copy(list).splice((start * amountPerPage), amountPerPage); | |
} |
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 hoist() { | |
for(var i = 0; i < 10 i++){ | |
var test = "Test"; | |
} | |
console.log(test); | |
} | |
function hoist2() { | |
var test; |
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 Rule = (function () { | |
function Rule(property, subValidator, instance) { | |
this.property = property; | |
this.subValidator = subValidator; | |
this.instance = instance; | |
} | |
return Rule; | |
})(); | |
var SubValidator = (function () { |
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 __extends = this.__extends || function (d, b) { | |
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | |
function __() { this.constructor = d; } | |
__.prototype = b.prototype; | |
d.prototype = new __(); | |
}; | |
var Immutable = (function () { | |
function Immutable() { | |
this.objectString = "object"; | |
} |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script> | |
window.xinj = function(obj) { | |
debugger; |
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
let createGroupings lineSeq = | |
lineSeq |> Seq.map (fun element -> element.[0]) | |
|> Seq.countBy id | |
|> Seq.toList | |
let list = ["asd"; "dsa"] | |
createGroupings list |
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
window.Bus = function(name, funcs, parent) { | |
funcs = funcs instanceof Array === true ? funcs : [funcs]; | |
var bus = {}; | |
var sub = new ko.subscribable(); | |
var functionType = "function"; | |
bus.name = name; | |
bus.children = []; | |
bus.previousMessages = []; | |
bus.extend = function(name, funcs) { | |
var childBus = window.Bus(name, funcs, bus); |
OlderNewer