Skip to content

Instantly share code, notes, and snippets.

@F1LT3R
Created April 8, 2015 14:52
Show Gist options
  • Select an option

  • Save F1LT3R/e1e32abcd89e97adf75c to your computer and use it in GitHub Desktop.

Select an option

Save F1LT3R/e1e32abcd89e97adf75c to your computer and use it in GitHub Desktop.
var app = angular.module('app.directives.myModule', []);
app.directive('myModule', [function () { return {
restrict: 'E',
scope: {
thingsA: '=',
thingsB: '=',
},
controller: ['$scope', function ($scope) {
$scope.$watch(function(onlyWhatChangedPlease){
// Logs whole $scope when only making changes to: thingsB
console.log(onlyWhatChangedPlease);
});
}],
template: '<div>{{things}}</div>'
}}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment