From ba3b87d2dd9ac37308a6f90f2088d02d88d0e32a Mon Sep 17 00:00:00 2001 From: Juanfran Date: Thu, 10 Sep 2015 08:36:48 +0200 Subject: [PATCH] allow decorators --- app/coffee/app.coffee | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/coffee/app.coffee b/app/coffee/app.coffee index acfe69ab..a40682fa 100644 --- a/app/coffee/app.coffee +++ b/app/coffee/app.coffee @@ -521,6 +521,12 @@ configure = ($routeProvider, $locationProvider, $httpProvider, $provide, $tgEven $translateProvider.fallbackLanguage(preferedLangCode) + # decoratos + decorators = _.where(@.taigaContribPlugins, {"type": "decorator"}) + + _.each decorators, (decorator) -> + $provide.decorator decorator.provider, decorator.decorator + i18nInit = (lang, $translate) -> # i18n - moment.js moment.locale(lang) @@ -619,6 +625,8 @@ init = ($log, $rootscope, $auth, $events, $analytics, $translate, $location, $na else navigationBarService.enableHeader() +pluginsWithModule = _.filter(@.taigaContribPlugins, (plugin) -> plugin.module) + modules = [ # Main Global Modules "taigaBase", @@ -664,7 +672,7 @@ modules = [ "pascalprecht.translate", "infinite-scroll", "tgRepeat" -].concat(_.map(@.taigaContribPlugins, (plugin) -> plugin.module)) +].concat(_.map(pluginsWithModule, (plugin) -> plugin.module)) # Main module definition module = angular.module("taiga", modules)