/angular-safeapply

used to call back into angularjs from external libs

Primary LanguageJavaScript

Safe Apply for AngularJS

Based on code from https://github.com/yearofmoo/AngularJS-Scope.SafeApply

  1. Open bower.json
  2. Add "angular-safeapply": "~1.0.0" to your dependency list
  3. Run bower install
  4. In your application you can now add:
    • <script src="components/angular-safeapply/safe-apply.js"></script>

Usage

Add SafeApply to your apps module dependancy list then

  1. on any scope: $scope.$safeApply(function() { optionalFunction; });
  2. or used as a service: $safeApply($scope, function() {});