<commit_before>angular.module('meganote.notes', [
  'ui.router'
])

.config(function($stateProvider) {
  $stateProvider

    .state('notes', {
      url: '/notes',
      templateUrl: 'notes/notes.html',
      controller: 'NotesController'
    })

    .state('notes.form', {
      url: '/:noteId',
      templateUrl: 'notes/notes-form.html'
    });
})

.controller('NotesController', function($scope) {
  $scope.editing = false;
  $scope.notes = [];
  $scope.note = {};
  $scope.addNote = function() {
    $scope.notes.push($scope.note);
    $scope.note = {};
    $scope.note.title = '';
    $scope.note.body = '';
  }
  $scope.removeNote = function(index) {
    $scope.notes.splice(index, 1);
  }
  $scope.editNote = function(note) {
    $scope.editing = true;
    $scope.note = note;
  }
  $scope.updateNote = function() {
    $scope.note = {};
    $scope.editing = false;
  }
});<commit_msg>Wrap meganote.notes module in an IIFE<commit_after>(function() {
  angular.module('meganote.notes', ['ui.router'])
  .config(notesConfig)
  .controller('NotesController', NotesController);

  function notesConfig($stateProvider) {
    $stateProvider

      .state('notes', {
        url: '/notes',
        templateUrl: 'notes/notes.html',
        controller: 'NotesController'
      })

      .state('notes.form', {
        url: '/:noteId',
        templateUrl: 'notes/notes-form.html'
      });
  }

  function NotesController($scope) {
    $scope.editing = false;
    $scope.notes = [];
    $scope.note = { title: '', body: ''};
    $scope.addNote = function() {
      $scope.notes.push($scope.note);
      $scope.note = {};
      $scope.note.title = '';
      $scope.note.body = '';
    }
    $scope.removeNote = function(index) {
      $scope.notes.splice(index, 1);
    }
    $scope.editNote = function(note) {
      $scope.editing = true;
      $scope.note = note;
    }
    $scope.updateNote = function() {
      $scope.note = {};
      $scope.editing = false;
    }
  }
})();
{'fraction_non_alphanumeric': 0.18775303643724697, 'fraction_numerical': 0.0010121457489878543, 'mean_word_length': 2.6341911764705883, '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': '3991810', 'n_tokens_mistral': 677, 'n_tokens_neox': 662, 'n_words': 98}