Created
July 6, 2017 21:15
-
-
Save glosik/26eaf57ed459274401792d087e961873 to your computer and use it in GitHub Desktop.
ng-content
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
} | |
}); | |
<input type="text" ng-bind-attrs="{placeholder: somePropertyOfTheScope, tabindex: anotherPropertyOfTheScope}" > |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment