tbouron commented on a change in pull request #154: add custom onChange 
directive to correct file uploader bug
URL: https://github.com/apache/brooklyn-ui/pull/154#discussion_r357184722
 
 

 ##########
 File path: ui-modules/utils/catalog-uploader/catalog-uploader.js
 ##########
 @@ -208,3 +211,20 @@ export function catalogUploaderService($q, catalogApi) {
         return defer.promise;
     }
 }
+
+export function customOnChangeDirective() {
+    return {
+        restrict: 'A',
+        link: function (scope, element, attrs) {
+            element.on('change', x => {
+                var onChangeHandler = scope.$eval(attrs.customOnChange);
+                onChangeHandler(x);
+            });
+            element.on('$destroy', function() {
+                element.off();
+            });
+
+
 
 Review comment:
   Couple of empty lines to remove

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to