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

[GitHub] brooklyn-ui pull request #108: improve logic and ui for inferring bundle and...

Github user tbouron commented on a diff in the pull request:
    --- Diff: ui-modules/blueprint-composer/app/components/catalog-saver/catalog-saver.directive.js ---
    @@ -223,3 +228,7 @@ function templateCache($templateCache) {
         $templateCache.put(TEMPLATE_URL, template);
         $templateCache.put(TEMPLATE_MODAL_URL, modalTemplate);
    +var bundlize = (input) => input && input.split(/[^a-zA-Z0-9]+/).filter(x => x).join('-').toLowerCase();
    --- End diff --
    Why create this `var` (which should be `let`) ? The function should live within `bundlizeProvider` which you can then call directly within this file with `bundlizeProvider()(input);`. Actually, as better way would be to rely on the `$filter` service like so: `$filter('bundlize`)(input);`