<commit_before>'use strict';

// Announcements controller
angular.module('core').controller('AnnouncementsController', ['$scope', '$stateParams', '$location', 'Authentication', 'Announcements',
  function ($scope, $stateParams, $location, Authentication, Announcements) {
    $scope.authentication = Authentication;

    //check for a link
    $scope.isThere = function (item) {
      console.log(item);
      if (item !== "") {
        return true;
      }
      return false;
    };

    //editting shows
    $scope.isEditing = false;

    // Create new Announcement
    $scope.create = function (isValid) {
      $scope.error = null;

      if (!isValid) {
        $scope.$broadcast('show-errors-check-validity', 'announcementForm');

        return false;
      }

      // Create new Announcement object
      var announcement = new Announcements({
        title: this.title,
        username: this.username,
        content: this.content,
        link: this.link,
        picture: this.picture
      });

      // Redirect after save<commit_msg>fixed the constant logging of items<commit_after>'use strict';

// Announcements controller
angular.module('core').controller('AnnouncementsController', ['$scope', '$stateParams', '$location', 'Authentication', 'Announcements',
  function ($scope, $stateParams, $location, Authentication, Announcements) {
    $scope.authentication = Authentication;

    //check for a link
    $scope.isThere = function (item) {
      if (item !== "") {
        return true;
      }
      return false;
    };

    //editting shows
    $scope.isEditing = false;

    // Create new Announcement
    $scope.create = function (isValid) {
      $scope.error = null;

      if (!isValid) {
        $scope.$broadcast('show-errors-check-validity', 'announcementForm');

        return false;
      }

      // Create new Announcement object
      var announcement = new Announcements({
        title: this.title,
        username: this.username,
        content: this.content,
        link: this.link,
        picture: this.picture
      });

      // Redirect after save
{'fraction_non_alphanumeric': 0.12958551691281564, 'fraction_numerical': 0.0, 'mean_word_length': 2.6082474226804124, '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': '15669', 'n_tokens_mistral': 586, 'n_tokens_neox': 575, 'n_words': 145}