Skip to content

Instantly share code, notes, and snippets.

@fauverism
Forked from mbenford/demo.html
Created March 18, 2015 19:06
Show Gist options
  • Save fauverism/263bfcd534eded6ab724 to your computer and use it in GitHub Desktop.
Save fauverism/263bfcd534eded6ab724 to your computer and use it in GitHub Desktop.
<input type="text" ng-bind-attrs="{placeholder: somePropertyOfTheScope, tabindex: anotherPropertyOfTheScope}" >
app.directive('ngBindAttrs', function() {
return function(scope, element, attrs) {
scope.$watch(attrs.ngBindAttrs, function(value) {
angular.forEach(value, function(value, key) {
attrs.$set(key, value);
})
}, true);
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment