Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hugojosefson/apply-safely-for-angular

Calls fn with or without scope.$apply(), depending on if current thread is already inside $apply(). For AngularJS.
https://github.com/hugojosefson/apply-safely-for-angular

Last synced: 29 days ago
JSON representation

Calls fn with or without scope.$apply(), depending on if current thread is already inside $apply(). For AngularJS.

Awesome Lists containing this project

README

        

# apply-safely-for-angular

Calls `fn` with or without `scope.$apply()`, depending on if current thread is already inside `$apply()`. For AngularJS.

## Installation

### As a [component](https://github.com/component/component)

$ component install hugojosefson/apply-safely-for-angular

### With [Bower](http://bower.io/)

$ bower install hugojosefson-apply-safely-for-angular

## API

require("applySafely");

// Example use
angular.module("yourModule", []).controller("yourController", function($scope, applySafely) {

someNonAngularCodeWhichCallsBack("params", function callback(result) {
applySafely($scope, function() {
$scope.result = result;
});
});

});

## License

MIT