Fork me on GitHub


This method wraps method to run it's callback in a digestion cycle so angular will detect the changes and update the views accordingly.


Param Type Details Required
name String

Name of method to invoke

arguments Any

Optional arguments to send to method

callback Function

Optional callback


Usage Example:

myModule.controller('MyCtrl', ['$scope', '$reactive', function($scope, $reactive) {
  $reactive(this).attach($scope);'add', 1, 2, (err, result) => {
    this.result = result;

The example above will invoke the meteor method add with 1 and 2 as parameters. When the result arrives arrives from the server, the callback method will run and then angular-meteor will run a digestive cycle on the scope.