Github user tbouron commented on a diff in the pull request:
https://github.com/apache/brooklyn-ui/pull/91#discussion_r227809083
--- Diff:
ui-modules/blueprint-composer/app/components/catalog-saver/catalog-saver.directive.js
---
@@ -54,11 +57,17 @@ export function saveToCatalogModalDirective($rootScope,
$uibModal) {
link: link
};
- function link($scope) {
+ function link($scope, $element) {
$scope.buttonText = $scope.config.label || ($scope.config.itemType
? `Update ${$scope.config.name || $scope.config.symbolicName}` : 'Add to
catalog');
+
+
$injector.get('$templateCache').put('catalog-saver.modal.template.html',
modalTemplate);
+
$scope.activateModal = () => {
+ // Override callback to update catalog configuration data in
other applications
+ $scope.config = (composerOverrides.updateCatalogConfig ||
(($scope, $element) => $scope.config))($scope, $element);
--- End diff --
I understand why you do this: to augment the scope and/or controller with
custom functions/objects.
But I'm wary of auto-calling an anonymous function, especially when the
scope is passed around. I don't have a better solution for this however. Any
thoughts on the matter @m4rkmckenna ?
---