2.1.0 • Published 4 years ago

@magnal/ng-lodash v2.1.0

Weekly downloads
5
License
MIT
Repository
github
Last release
4 years ago

code style: prettier

ng-lodash

ng-lodash is a Angular library which provides pipes for lodash functions.

🚀 Setting Up

Install

npm install @magnal/ng-lodash

Import

import {NgLodashModule} from '@magnal/ng-lodash';

@NgModule({
  imports: [
    NgLodashModule
  ]
})
export class FooModule {}

⚙ Usage

When the module is imported, all pipes can be used like every other pipe in Angular.

When you follow the recommendation of angular.io regarding the use of a SharedModule you can also import and re-export it there. Adding it to your own shared component library is of course also possible.

Pipes

Not every lodash function has what it takes to become a Angular pipe. The following functions are implemented so far.

Array

lodash functionpipe name
_.chunk_chunk
_.compact_compact
_.concat_concat
_.difference_difference
_.drop_drop
_.dropRight_dropRight
_.fill_fill
_.first_first
_.flatten_flatten
_.flattenDeep_flattenDeep
_.flattenDepth_flattenDepth
_.fromPairs_fromPairs
_.head_head
_.indexOf_indexOf
_.initial_initial
_.intersection_intersection
_.join_join
_.last_last
_.lastIndexOf_lastIndexOf
_.nth_nth
_.pull_pull
_.pullAll_pullAll
_.pullAt_pullAt

Object

lodash functionpipe name
_.get_get
_.has_has
_.set_set

You miss a lodash function here? Feel free to create an issue for that. ❤

2.2.0-rc.2

4 years ago

2.2.0-rc.1

4 years ago

2.1.0

4 years ago

2.0.0

4 years ago

1.0.0

5 years ago