<commit_before>(function() {
    'use strict';

    angular.module('app.widgets', [
        'app.services',
        'rzModule',
        'web.colorpicker'
    ])
    .value('WidgetTypes', [])
    .factory('Widgets', WidgetsService)
    .directive('genericWidget', GenericWidgetDirective);

    WidgetsService.$inject = ['WidgetTypes'];
    function WidgetsService(widgetTypes) {

        var service = {
            registerType: registerType,
            getWidgetTypes: getWidgetTypes
        }

        return service;

        ////////////////
        
        function registerType(name) {
            widgetTypes.push(name);
            console.log("Registered widget type: " + name);
        }

        function getWidgetTypes() {
            return widgetTypes;
        }

    }

    GenericWidgetDirective.$inject = ['$compile', 'Widgets'];
    function GenericWidgetDirective($compile, widgets) {
        var directive = {
            restrict: 'AE',
            replace: true,
            scope: {
                type: '=',
                ngModel: '='
            },
            link: function (scope, element, attrs) {
                element.html('<widget-' + scope.type + ' ng-model="ngModel"><widget-' + scope.type + '>');
                $compile(element.contents())(scope);<commit_msg>Fix closing tag in genericWidget directive<commit_after>(function() {
    'use strict';

    angular.module('app.widgets', [
        'app.services',
        'rzModule',
        'web.colorpicker'
    ])
    .value('WidgetTypes', [])
    .factory('Widgets', WidgetsService)
    .directive('genericWidget', GenericWidgetDirective);

    WidgetsService.$inject = ['WidgetTypes'];
    function WidgetsService(widgetTypes) {

        var service = {
            registerType: registerType,
            getWidgetTypes: getWidgetTypes
        }

        return service;

        ////////////////
        
        function registerType(name) {
            widgetTypes.push(name);
            console.log("Registered widget type: " + name);
        }

        function getWidgetTypes() {
            return widgetTypes;
        }

    }

    GenericWidgetDirective.$inject = ['$compile', 'Widgets'];
    function GenericWidgetDirective($compile, widgets) {
        var directive = {
            restrict: 'AE',
            replace: true,
            scope: {
                type: '=',
                ngModel: '='
            },
            link: function (scope, element, attrs) {
                element.html('<widget-' + scope.type + ' ng-model="ngModel"></widget-' + scope.type + '>');
                $compile(element.contents())(scope);
{'fraction_non_alphanumeric': 0.14074355083459789, 'fraction_numerical': 0.0, 'mean_word_length': 1.8083067092651757, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4413574', 'n_tokens_mistral': 702, 'n_tokens_neox': 676, 'n_words': 124}