Skip to content
This repository has been archived by the owner on Apr 19, 2021. It is now read-only.

lodash 4.x updates #16

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions angular-lodash.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
// Shiv "filter", "reject" to angular's built-in,
// and reserve lodash's feature(works on obj).
ng.injector(['ng']).invoke(['$filter', function($filter) {
_.filter = _.select = _.wrap($filter('filter'), function(filter, obj, exp) {
_.filter = _.wrap($filter('filter'), function(filter, obj, exp) {
if(!(_.isArray(obj))) {
obj = _.toArray(obj);
}
Expand All @@ -60,7 +60,7 @@

// begin register angular-lodash/utils

_.each(_.methods(_), function(methodName) {
_.each(_.functions(_), function(methodName) {
function register($rootScope) {$rootScope[methodName] = _.bind(_[methodName], _);}

_.each([
Expand All @@ -84,11 +84,8 @@
['reduceRight', 'foldr'],
['find', 'detect'],
['filter', 'select'],
'where',
'findWhere',
'reject',
'invoke',
'pluck',
'max',
'min',
'sortBy',
Expand All @@ -100,22 +97,22 @@
['first', 'head', 'take'],
'initial',
'last',
['rest', 'tail', 'drop'],
['tail', 'drop'],
'compact',
'flatten',
'without',
'union',
'intersection',
'difference',
['uniq', 'unique'],
'uniq',
'zip',
'object',
'fromPairs',
'indexOf',
'lastIndexOf',
'sortedIndex',
'keys',
'values',
'pairs',
'toPairs',
'invert',
['functions', 'methods'],
'pick',
Expand Down