This file contains hidden or 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('ng').directive('ngBindonce', function() { | |
return function bindOnce($scope, $element, $attrs) { | |
var removeWatcher = $scope.$watch($attrs.ngBindOnce, function(value) { | |
if (value === undefined) return; | |
$element.text(value); | |
removeWatcher(); | |
}); | |
}; | |
}); |
This file contains hidden or 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 gulp = require('gulp'), | |
concat = require('gulp-concat'), | |
wrap = require('gulp-wrap'), | |
multipipe = require('multipipe'), | |
spaceRe = /\s+/g, | |
wrapper = '(function(undefined){\n\n<%= contents %>\n}());'; | |
module.exports = function buildModule(src, dest, watch) { | |
var name = String(src).replace(spaceRe, '-'); |
This file contains hidden or 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() { | |
function only(propertiesToKeep){ | |
var object = this; | |
if (object === window) return object; | |
Object.keys(object).forEach(function(key) { | |
if (propertiesToKeep.indexOf(key) === -1) delete object[key]; | |
}); | |
This file contains hidden or 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
/* | |
* Exemplo: | |
* var users = [ | |
* {name: 'Victor Queiroz'}, | |
* {name: 'João Bosco'}, | |
* {name: 'Ruan Jordão'} | |
* ]; | |
* | |
* Aplicando o filtro: | |
* {{ users | pluck:'name' | join:', ' }} |
NewerOlder