You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by GitBox <gi...@apache.org> on 2019/12/12 14:48:36 UTC

[GitHub] [brooklyn-ui] tbouron commented on a change in pull request #154: add custom onChange directive to correct file uploader bug

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:
users@infra.apache.org


With regards,
Apache Git Services