<commit_before>angular.module('multiStepForm')
/**
 * @ngdoc   function
 * @name    multiStepForm:formStepElement
 *
 * @requires $rootScope
 * @requires $controller
 *
 * @description A factory function for creating form step elements
 *              (using controller, template and resolve)
 */
.factory('formStepElement', [
    '$compile',
    '$controller',
    '$http',
    '$injector',
    '$q',
    '$templateCache',
    function ($compile, $controller, $http, $injector, $q, $templateCache) {
        /**
         * Resolve the template of a form step
         * @param  {FormStep} formStep The form step object
         * @return {Promise|String}    A promise containing the template
         */
        function resolveTemplate(formStep) {
            if (formStep.template) {
                // If function or array, use $injector to get template value
                return angular.isFunction(formStep.template) || angular.isArray(formStep.template) ?
                    $injector.$invoke(formStep.template) :
                    formStep.template;
            }
            // Use templateUrl
            var templateUrl =
                // If function or array, use $injector to get templateUrl value
                angular.isFunction(formStep.templateUrl) || angular.isArray(formStep.templateUrl) ?
                $injector.$invoke(formStep.templateUrl) :
                formStep.templateUrl;
            // Request templateUrl using $templateCache
            return $http.get(formStep.templateUrl, {cache: $templateCache});
        }

        /**
         * Create a new scope with the multiStepContainer being the parent scope.
         * augmented with multi step form control methods.
         * @param  {FormStep} formStep The form step object
         * @param  {FormStep} formStep The form step object
         * @return {Object} The form step scope
         */
        function getScope(scope, formStep, multiStepFormInstance) {
            var stepScope = scope.$new(formStep.isolatedScope);
            // Augment scope with multi step form instance methods
            multiStepFormInstance.augmentScope(stepScope);

            return stepScope;
        }

        /**
         * Create a form step element, compiled with controller and dependencies resolved
         *
         * @param  {FormStep} formStep            The form step object<commit_msg>fix: resolving templateUrl if DI (function or annotated array)<commit_after>angular.module('multiStepForm')
/**
 * @ngdoc   function
 * @name    multiStepForm:formStepElement
 *
 * @requires $rootScope
 * @requires $controller
 *
 * @description A factory function for creating form step elements
 *              (using controller, template and resolve)
 */
.factory('formStepElement', [
    '$compile',
    '$controller',
    '$http',
    '$injector',
    '$q',
    '$templateCache',
    function ($compile, $controller, $http, $injector, $q, $templateCache) {
        /**
         * Resolve the template of a form step
         * @param  {FormStep} formStep The form step object
         * @return {Promise|String}    A promise containing the template
         */
        function resolveTemplate(formStep) {
            if (formStep.template) {
                // If function or array, use $injector to get template value
                return angular.isFunction(formStep.template) || angular.isArray(formStep.template) ?
                    $injector.$invoke(formStep.template) :
                    formStep.template;
            }
            // Use templateUrl
            var templateUrl =
                // If function or array, use $injector to get templateUrl value
                angular.isFunction(formStep.templateUrl) || angular.isArray(formStep.templateUrl) ?
                $injector.$invoke(formStep.templateUrl) :
                formStep.templateUrl;
            // Request templateUrl using $templateCache
            return $http.get(templateUrl, {cache: $templateCache});
        }

        /**
         * Create a new scope with the multiStepContainer being the parent scope.
         * augmented with multi step form control methods.
         * @param  {FormStep} formStep The form step object
         * @param  {FormStep} formStep The form step object
         * @return {Object} The form step scope
         */
        function getScope(scope, formStep, multiStepFormInstance) {
            var stepScope = scope.$new(formStep.isolatedScope);
            // Augment scope with multi step form instance methods
            multiStepFormInstance.augmentScope(stepScope);

            return stepScope;
        }

        /**
         * Create a form step element, compiled with controller and dependencies resolved
         *
         * @param  {FormStep} formStep            The form step object
{'fraction_non_alphanumeric': 0.09019118869492934, 'fraction_numerical': 0.0, 'mean_word_length': 2.1131953428201813, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1776481', 'n_tokens_mistral': 1189, 'n_tokens_neox': 1158, 'n_words': 361}