I hereby claim:
- I am justinwinslow on github.
- I am jwin (https://keybase.io/jwin) on keybase.
- I have a public key whose fingerprint is 465E 9D17 019E 4F5C DE28 6E15 AC1A DB8F BAE2 D3DC
To claim this, I am signing this object:
angular.module('Module', []) | |
.directive('ngActuallyChecked', function(){ | |
return { | |
link: function(scope, el, attrs) { | |
// Let's immediately store the value of our expression | |
var actualValue = scope.$eval(attrs.ngActuallyChecked); | |
// Don't let clicks overwrite our actual value | |
el.on('click', function(event){ | |
el.prop('checked', actualValue); |
$provide.decorator('$http', ['$delegate', function($delegate) { | |
// Angular injects the service as $delegate | |
var $http = $delegate; | |
// Store promises for requests | |
var pendingRequests = []; | |
// Let's overwrite the get method to prevent duplicate queries | |
$http.get = function (url, config) { | |
config = config || {}; | |
// Let's make a simple key for us to reference on subsequent requests |
angular.module('someModule', []) | |
.directive('ngRepeatTimer', function() { | |
var start; | |
return function(scope) { | |
if (scope.$first) { | |
start = new Date().getTime(); | |
} | |
if (scope.$last){ | |
console.log('ng-repeat rendering time:', new Date().getTime() - start); | |
} |
// Grab or create stored data | |
$scope.localData = JSON.parse(localStorage.getItem('localData')) || {}; | |
// Watch for items to change and update data in localStorage | |
$scope.$watch('localData', function(localData, oldLocalData){ | |
if (localData != oldLocalData) { | |
localStorage.setItem('localData', JSON.stringify($scope.localData)); | |
} | |
}, true); |
I hereby claim:
To claim this, I am signing this object:
/* | |
TODO | |
[ ] Returns return a $q promise or the $resource return. Need to mimic the | |
$resource return for all returns | |
[ ] Extend Collection with underscore methods | |
*/ | |
angular.module('ngCollection', ['ngResource']) | |
.factory('$collection', ['$resource', '$q', function($resource, $q){ | |
// Collection constructor |
// State example: | |
// | |
// $stateProvider | |
// .state('state', { | |
// url: 'state/:id', | |
// template: stateTemplate, | |
// controller: stateController, | |
// // Expose parameters in display names using {:param} syntax | |
// displayName: 'State ({:id})' | |
// }); |
<!-- This assumes you are using ngResource to request data (http://docs.angularjs.org/api/ngResource.$resource) --> | |
<ul> | |
<!-- | |
We can use ng-show="{expression}" to programmatically display something. | |
ngResouce adds a handy $resolved property to your data objects. | |
So, let's key off of that to indicate loading | |
--> | |
<li ng-show="!things.$resolved">Loading...</li> |
js/
angular.module('Application', ['ModuleA', 'AppViewACtrl', 'lodash', function(){}]);
var lodash = angular.module('lodash', []);
lodash
.factory('_', function() {
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: intelligentarray | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Uses forever to manage the node.js application | |
# Description: Launches a node.js application using forever. | |
### END INIT INFO |