Fork me on GitHub


Use this method to get a context variable and watch it reactively, so each change of this variable causes the dependents (autorun, helper functions and subscriptions) to run again.

The getReactively method is part of the ReactiveContext, and available on every context and $scope.


Name Type Details Required
variableName String The name of the context's variable to bind to Yes
objectEquality Function
Use true to deep watch the object, or a function to provide custom equality function. The default value is false, which does a shallow / reference watch only. No

Return value

This method returns the current value of the reactive variable.

Example with subscribe:

myModule.controller('MyCtrl', ['$scope', '$reactive', function($scope, $reactive) {

  this.relevantId = 10;

  this.subscribe('users', () => {
    return [ this.getReactively('relevantId') ];

  this.relevantId = 50; // This will cause the subscribe arguments method to run again

Example with helpers:

myModule.controller('MyCtrl', ['$scope', '$reactive', function($scope, $reactive) {

  this.myUser: {
    id: 10

    myData: () => {
      return Data.find({_id: this.getReactively('')});
  }); = 29; // This will cause the helper to run again and update the view