Skip to content

Instantly share code, notes, and snippets.

@Vayvala
Created January 30, 2016 18:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Vayvala/badc071a8a7fdc3c60c2 to your computer and use it in GitHub Desktop.
Save Vayvala/badc071a8a7fdc3c60c2 to your computer and use it in GitHub Desktop.
// ES5
$scope.$watch(angular.bind(this, function() {
return this.someObject;
}), function (newValue, oldValue) {
// do some stuff
});
// ES6
$scope.$watch(() => this.someObject, function(newValue, oldValue) {
// do some stuff
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment