Skip to content

Instantly share code, notes, and snippets.

@kis
Created April 6, 2016 14:04
Show Gist options
  • Select an option

  • Save kis/b2eebe0f5af815bf0b92142baddf0716 to your computer and use it in GitHub Desktop.

Select an option

Save kis/b2eebe0f5af815bf0b92142baddf0716 to your computer and use it in GitHub Desktop.
var unwatch = scope.$watch(function() {
return ngModel.$modelValue;
}, function(newValue) {
if (newValue && (newValue.charAt(0) == '&' || newValue.charAt(0) == '?')) {
//scope[attrs.ngModel] = newValue.slice(1);
}
});
ngModel.$modelValue = newVal;
scope.$on('$destroy', function() {
unwatch();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment