<commit_before>(function() {
  'use strict';

  angular
    .module('meganote.notes')
    .controller('NotesFormController', NotesFormController);

  NotesFormController.$inject = ['notesService', '$state'];

  function NotesFormController(notesService, $state) {
    var vm = this;

    vm.note = notesService.find($state.params.noteId);
    vm.saveNote = saveNote;
    vm.deleteNote = deleteNote;
    vm.resetForm = resetForm;

    /////////////////

    function saveNote() {
      notesService.saveNote(vm.note).then(function(res) {
        vm.note = angular.copy(res.data.note);
      });
    }

    function deleteNote(note) {
      notesService.deleteNote(note);
      resetForm();
    }

    function resetForm() {
      vm.note = new notesService.Note();
    }

  }

})();<commit_msg>Add state.go to saveNote and deleteNote functions.  Remove unnecessary resetForm function<commit_after>(function() {
  'use strict';

  angular
    .module('meganote.notes')
    .controller('NotesFormController', NotesFormController);

  NotesFormController.$inject = ['notesService', '$state'];

  function NotesFormController(notesService, $state) {
    var vm = this;

    vm.note = notesService.find($state.params.noteId);
    vm.saveNote = saveNote;
    vm.deleteNote = deleteNote;

    /////////////////

    function saveNote() {
      notesService.saveNote(vm.note).then(function(res) {
        vm.note = angular.copy(res.data.note);
        $state.go('notes.form', { noteId: vm.note._id });
      });
    }

    function deleteNote(note) {
      notesService.deleteNote(note);
      $state.go('notes.form', { noteId: undefined });
    }
  }

})();
{'fraction_non_alphanumeric': 0.16252274105518497, 'fraction_numerical': 0.0, 'mean_word_length': 2.900709219858156, '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': '3846860', 'n_tokens_mistral': 509, 'n_tokens_neox': 488, 'n_words': 84}