<commit_before>angular.module('examples', [])

.factory('formPostData', ['$document', function($document) {
  return function(url, fields) {
    var form = angular.element('<form style="display: none;" method="post" action="' + url + '" target="_blank"></form>');
    angular.forEach(fields, function(value, name) {
      var input = angular.element('<input type="hidden" name="' +  name + '">');
      input.attr('value', value);
      form.append(input);
    });
    $document.find('body').append(form);
    form[0].submit();
    form.remove();
  };
}])


.factory('openPlunkr', ['formPostData', '$http', '$q', function(formPostData, $http, $q) {
  return function(exampleFolder) {

    var exampleName = 'AngularJS Example';
<commit_msg>fix(docs): change plnkr form to open in same window<commit_after>angular.module('examples', [])

.factory('formPostData', ['$document', function($document) {
  return function(url, fields) {
    /**
     * Form previously posted to target="_blank", but pop-up blockers were causing this to not work.
     * If a user chose to bypass pop-up blocker one time and click the link, they would arrive at
     * a new default plnkr, not a plnkr with the desired template.
     */
    var form = angular.element('<form style="display: none;" method="post" action="' + url + '"></form>');
    angular.forEach(fields, function(value, name) {
      var input = angular.element('<input type="hidden" name="' +  name + '">');
      input.attr('value', value);
      form.append(input);
    });
    $document.find('body').append(form);
    form[0].submit();
    form.remove();
  };
}])


.factory('openPlunkr', ['formPostData', '$http', '$q', function(formPostData, $http, $q) {
  return function(exampleFolder) {

    var exampleName = 'AngularJS Example';

{'fraction_non_alphanumeric': 0.18385650224215247, 'fraction_numerical': 0.0011210762331838565, 'mean_word_length': 4.1, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '4004280', 'n_tokens_mistral': 547, 'n_tokens_neox': 533, 'n_words': 139}