codehaus


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GitHub] brooklyn-ui pull request #106: Update save to catalog action


Github user tbouron commented on a diff in the pull request:

    https://github.com/apache/brooklyn-ui/pull/106#discussion_r232208108
  
    --- Diff: ui-modules/blueprint-composer/app/components/catalog-saver/catalog-saver.directive.js ---
    @@ -60,12 +60,47 @@ export function saveToCatalogModalDirective($rootScope, $uibModal, $injector, co
             link: link
         };
     
    -    function link($scope, $element) {
    +    function link($scope, $element, $compile, controller) {
             $scope.buttonText = $scope.config.label || ($scope.config.itemType ? `Update ${$scope.config.name || $scope.config.symbolicName}` : 'Add to catalog');
     
             $scope.activateModal = () => {
    -            // Override callback to update catalog configuration data in other applications
    -            $scope.config = (composerOverrides.updateCatalogConfig || (($scope, $element) => $scope.config))($scope, $element);
    +            function injectorGet(reference) { return $element.injector().get(reference); }
    +            function blueprintService() { return injectorGet('blueprintService'); }
    --- End diff --
    
    Instead of using the `$injector`, you can inject `blueprintService` directly in `saveToCatalogModalDirective`


---