// /// <reference path='../../../typings/node/node.d.ts' />
"use strict";
var angular = require("angular");
var _ = require("lodash");
exports.moduleName = 'rl.ui.components.cardContainer.filters.cardContainerFilters';
exports.componentName = 'rlCardContainerFilters';
exports.controllerName = 'CardContainerFiltersController';
var CardContainerFiltersController = (function () {
    function CardContainerFiltersController($rootScope) {
        this.$rootScope = $rootScope;
    }
    CardContainerFiltersController.prototype.$onInit = function () {
        var _this = this;
        this.renderableFilters = _(this.filters).filter(function (filter) {
            return filter.template != null;
        }).map(function (filter) {
            var scope = _this.$rootScope.$new();
            scope.filter = filter;
            scope.dataSource = _this.source;
            filter.template = {
                template: filter.template,
                scope: scope,
            };
            return filter;
        }).value();
    };
    return CardContainerFiltersController;
}());
CardContainerFiltersController.$inject = ['$rootScope'];
exports.CardContainerFiltersController = CardContainerFiltersController;
var cardContainerFilters = {
    template: require('./cardContainerFilters.html'),
    controller: exports.controllerName,
    controllerAs: 'controller',
    bindings: {
        filters: '<',
        source: '<',
    },
};
angular.module(exports.moduleName, [])
    .component(exports.componentName, cardContainerFilters)
    .controller(exports.controllerName, CardContainerFiltersController);
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FyZENvbnRhaW5lckZpbHRlcnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJjYXJkQ29udGFpbmVyRmlsdGVycy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSwyREFBMkQ7O0FBRTNELGlDQUFtQztBQUNuQywwQkFBNEI7QUFNakIsUUFBQSxVQUFVLEdBQVcsNkRBQTZELENBQUM7QUFDbkYsUUFBQSxhQUFhLEdBQVcsd0JBQXdCLENBQUM7QUFDakQsUUFBQSxjQUFjLEdBQVcsZ0NBQWdDLENBQUM7QUFnQnJFO0lBTUMsd0NBQW9CLFVBQXFDO1FBQXJDLGVBQVUsR0FBVixVQUFVLENBQTJCO0lBQUksQ0FBQztJQUU5RCxnREFBTyxHQUFQO1FB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