angular-lodash

WebJar for angular-lodash

License

License

MIT
Categories

Categories

Angular User Interface Web Frameworks
GroupId

GroupId

org.webjars.bower
ArtifactId

ArtifactId

angular-lodash
Last Version

Last Version

0.1.2
Release Date

Release Date

Type

Type

jar
Description

Description

angular-lodash
WebJar for angular-lodash
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/cabrel/angular-lodash

Download angular-lodash

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.bower/angular-lodash/ -->
<dependency>
    <groupId>org.webjars.bower</groupId>
    <artifactId>angular-lodash</artifactId>
    <version>0.1.2</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bower/angular-lodash/
implementation 'org.webjars.bower:angular-lodash:0.1.2'
// https://jarcasting.com/artifacts/org.webjars.bower/angular-lodash/
implementation ("org.webjars.bower:angular-lodash:0.1.2")
'org.webjars.bower:angular-lodash:jar:0.1.2'
<dependency org="org.webjars.bower" name="angular-lodash" rev="0.1.2">
  <artifact name="angular-lodash" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bower', module='angular-lodash', version='0.1.2')
)
libraryDependencies += "org.webjars.bower" % "angular-lodash" % "0.1.2"
[org.webjars.bower/angular-lodash "0.1.2"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.bower : lodash jar [2.4.1,2.5)

Project Modules

There are no modules declared in this project.

An AngularJS module adapting lodash

A fork of angular-underscore

This module exposes lodash's API into angular app's root scope, and provides some filters from lodash.

How to use

Install

After loading angular.js and lodash.js:

<script type="text/javascript" src="angular-lodash.js"></script>

Load angular-lodash

Load the whole library

angular.module('app', ['angular-lodash']);

Usecase

uniq

<script type="text/javascript">
  angular.module('example', ['angular-lodash']);
  app.controller('MainCtrl', function($scope) {});
</script>

<body ng-app="example">
  <div ng-controller="MainCtrl">
    <!-- output unique numbers from input.. [1, 2, 3, 4, 5, 6, 7, 8] -->
    <div ng-repeat="num in [1,1,2,3,4,5,5,6,6,7,7,7,8]|uniq">{{num}}</div>
  </div>
</body>

pluck

<script type="text/javascript">
  angular.module('example', ['angular-lodash']);
  app.controller('MainCtrl', function($scope) {
      $scope.exarr = [
        { 'name': 'John', 'age': 26 },
        { 'name': 'Bob', 'age': 41 },
        { 'name': 'Tom', 'age': 32 },
        { 'name': 'Ralph', 'age': 17 },
        { 'name': 'Molly', 'age': 13 }
      ];
  });
</script>

<body ng-app="example">
  <div ng-controller="MainCtrl">
    <div ng-repeat="age in exarr|pluck:'age'">{{age}}</div>
  </div>
</body>

keys

<script type="text/javascript">
  angular.module('example', ['angular-lodash']);
  app.controller('MainCtrl', function($scope) {                                                                                                                                                        
    $scope.exobj = {
      'key1': {
        'subkey1': 1
      },
      'key2': {
        'subkey2': 2
      },
      'key3': {
        'subkey3': 3,
        'subkey31': 31
      }
    };
  }); 
</script>

<body ng-app="example">
  <div ng-controller="MainCtrl">
    <div ng-repeat="k in exobj|keys">{{k}}</div>
  </div>
</body>

Versions

Version
0.1.2