More info at http://www.benlesh.com
Open license.. use however. EXCEPT THIS README, IF YOU USE THIS I'LL SUE.
console.clear(); | |
var $locale = locale; | |
function forEach(coll, fn) { | |
var type = Object.prototype.toString.call(coll); | |
if(type === '[object Array]') { | |
//HACK new browsers only | |
coll.forEach(fn); | |
} else if(type === '[object Object]') { |
/** | |
* @license AngularJS v1.3.0-local+sha.8548c99 | |
* (c) 2010-2014 Google, Inc. http://angularjs.org | |
* License: MIT | |
*/ | |
(function(window, document, undefined) {'use strict'; | |
/** | |
* @description | |
* |
More info at http://www.benlesh.com
Open license.. use however. EXCEPT THIS README, IF YOU USE THIS I'LL SUE.
Working with @ebryn on a particular control that we discovered to be a pretty challenging and interesting problem to solve in EmberJS. Wanted to solve the same problem in AngularJS so we could discuss and draw comparisons. It seems to me at this point in both frameworks the situation is mostly covered, but perhaps requires some wiring that would be unintuitive for the average developer.
A generic table control with templatable columns. Given a data set in the form of an array of objects, we need a customizable table because we need to do things like show/hide columns, sort consistantly, etc.
/** | |
* Binary Tree | |
* (c) 2014 Ben Lesh <[email protected]> | |
* MIT license | |
*/ | |
/* | |
* A simple Binary Tree implementation in JavaScript | |
*/ |
# Remove OpenJRE stuff | |
sudo apt-get remove openjre* | |
# Add PPA to pull down Oracle JRE | |
sudo add-apt-repository ppa:webupd8team/java | |
# Get an updated list of packages | |
sudo apt-get update | |
# Install java 7 |
angular.module('myApp').controller('MainCtrl', ['$scope', 'people', function($scope, people) { | |
var self = this; | |
self.personSuccess = function(result) { | |
}; | |
self.personFail = function(result) { | |
$scope.errorMessage = 'failed to load person'; | |
}; |
var app = angular.module('myApp', []); | |
/* Set up a simple controller with a few | |
* examples of common actions a controller function | |
* might set up on a $scope. */ | |
app.controller('MainCtrl', function($scope, someService) { | |
//set some properties | |
$scope.foo = 'foo'; | |
$scope.bar = 'bar'; |
[ | |
{ | |
"text": "George Washington", | |
"type": "Person" | |
}, | |
{ | |
"text": "Abraham Lincoln", | |
"type": "Person" | |
} | |
] |
/* | |
Copyright (c) 2013 Ben Lesh | |
[email protected] | |
MIT License | |
*/ | |
;(function () { | |
var proto = Date.prototype; | |
function adder(value, getter, setter, toAdd) { | |
var d = new Date(value), |