Created
December 29, 2017 13:52
-
-
Save vivainio/69741abc13d03481ccd9477b1b94a7e4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| angular.module('app').directive('props', function() { | |
| return { | |
| link: function(scope, element, attrs) { | |
| scope.$watchCollection(attrs.props, function(newValues) { | |
| for (const key in newValues) { | |
| if (newValues.hasOwnProperty(key)) { | |
| element[0][key] = newValues[key]; | |
| } | |
| } | |
| }); | |
| } | |
| }; | |
| }); | |
| export {}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment