underscore-angularized

WebJar for underscore-angularized

License

License

MIT
Categories

Categories

Angular User Interface Web Frameworks
GroupId

GroupId

org.webjars.bower
ArtifactId

ArtifactId

underscore-angularized
Last Version

Last Version

1.7.0
Release Date

Release Date

Type

Type

jar
Description

Description

underscore-angularized
WebJar for underscore-angularized
Project URL

Project URL

http://webjars.org

Download underscore-angularized

How to add to project

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

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.bower : angular jar [1.2.0,2)

Project Modules

There are no modules declared in this project.

Underscore-Angularized

AngularJS wrapper for Underscore

Build Status

What is it?

Underscore is a fantastic JavaScript library and it's an invaluable tool for web developers. I made this wrapper to solve two particular issues for Angular developers.

  • Underscore is now fully in the Angular digest lifecycle: Underscore provides a number of asynchronous functions that falls outside of the angular lifecycle and it's up to you to manage it with manual $scope.$apply() calls. (_.throttle and _.debounce as examples) You can now use any function provided by Underscore and it will be in the angular lifecycle.
  • It's now off the global scope: Angular provides an excellent Dependency Injection system and Underscore is now an injectable service. This keeps it off the global namespace and helps with unit testing.

The only part of Underscore that's been modified is that all setTimeout and clearTimeout calls have been respectively replaced with $timeout and $timeout.cancel(). Besides those changes it's 100% stock Underscore.

Dependencies

AngularJS : 1.2+ (It's possible this will work on older versions of Angular . Older versions of Angular have not been tested and it's not currently supported.)

Installation

Project files are also available through Bower

bower install underscore-angularized

or GitHub:

git clone https://github.com/ng-angularized/underscore-angularized.git

Then load the module into your main module.

angular.module('myModule', ['underscore-angularized']);

Usage

To use underscore, just load it as a dependency into your module.

angular.module('myModule').controller('myController', ['underscore', function(_){
    //Use Underscore here...
}])

Supported browsers

Directives from this repository are automatically tested with the following browsers:

  • Chrome
  • Firefox
  • IE 9+
  • Opera
  • Safari

Modern mobile browsers should work without problems.

Tests (using PhantomJS)

Install Dependencies for Testing

  • Install Node.js and NPM
  • Install local dev dependencies: npm install while current directory is underscore-angularized repo

Run the tests

  • Run Default test: grunt run test

Browser Based Tests

  • Run Chrome tests: grunt run test-chrome
  • Run Firefox tests: grunt run test-firefox
  • Run IE tests: grunt run test-ie
NOTE: The tests are split apart to ensure it always runs in PhantomJS. If you want to test in a particular browser, just run that test!

Versions

Version
1.7.0