<commit_before>'use strict';

/**
 * @ngdoc directive
 * @name chusrodriguezApp.directive:imageField
 * @description
 * # imageField
 */
angular.module('chusrodriguezApp')
  .directive('imageField', ['Admin', 'Upload', '$rootScope', function (Admin, Upload, $rootScope) {
    return {
      templateUrl: 'views/admin/image-field.html',
      restrict: 'E',
      replace: true,
      link: function postLink(scope, element, attrs) {
        if(!scope.value.text) {
          scope.value.text = '';
          scope.images = [];
        }
        else {
          scope.images = scope.value.text.split(',');
        }

        scope.ready = true;
        scope.uploading = false;
        scope.process = '';

        scope.upload = function (file) {
          if(!file.length) return;
          scope.ready = false;<commit_msg>Waiting for entity to resolve.<commit_after>'use strict';

/**
 * @ngdoc directive
 * @name chusrodriguezApp.directive:imageField
 * @description
 * # imageField
 */
angular.module('chusrodriguezApp')
  .directive('imageField', ['Admin', 'Upload', '$rootScope', function (Admin, Upload, $rootScope) {
    return {
      templateUrl: 'views/admin/image-field.html',
      restrict: 'E',
      replace: true,
      link: function postLink(scope, element, attrs) {

        function init() {
          if(!scope.value.text) {
            scope.value.text = '';
            scope.images = [];
          }
          else {
            scope.images = scope.value.text.split(',');
          }
        }

        if(scope.entity.$resolved === false) {
          scope.$watch('entity.$resolved', function(newVal) {
            if(newVal) {
              init();
            }
          })
        }
        else {
          init()
        }

        scope.ready = true;
        scope.uploading = false;
        scope.process = '';

        scope.upload = function (file) {
          if(!file.length) return;
          scope.ready = false;
{'fraction_non_alphanumeric': 0.14687819856704196, 'fraction_numerical': 0.0, 'mean_word_length': 1.9666160849772383, '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': '1993536', 'n_tokens_mistral': 576, 'n_tokens_neox': 568, 'n_words': 107}