<commit_before>(function(){
  'use strict';
  angular.module('fsCloneShared')
    .directive('fsNoteEdit', function() {

      // emit: save(note, reason)

      return {
        templateUrl: 'fsCloneShared/fsNote/fsNoteEdit/fsNoteEdit.tpl.html',
        scope: {
          note: '=',
          agent: '='
        },
        link: function(scope) {
          // populate the form from the note
          scope.$watch(function() {
            return scope.note;
          }, function() {
            scope.form = {
              subject: scope.note ? scope.note.subject : '',
              text: scope.note ? scope.note.text : ''
            };
          }, true);

          // save the form to the note
          scope.$on('save', function(event, note) {
            event.stopPropagation();
            note.subject = scope.form.subject;
            note.text = scope.form.text;<commit_msg>remember reason when populating form from note<commit_after>(function(){
  'use strict';
  angular.module('fsCloneShared')
    .directive('fsNoteEdit', function() {

      // emit: save(note, reason)

      return {
        templateUrl: 'fsCloneShared/fsNote/fsNoteEdit/fsNoteEdit.tpl.html',
        scope: {
          note: '=',
          agent: '='
        },
        link: function(scope) {
          // populate the form from the note
          scope.$watch(function() {
            return scope.note;
          }, function() {
            scope.form = {
              subject: scope.note ? scope.note.subject : '',
              text: scope.note ? scope.note.text : '',
              reason: scope.form ? scope.form.reason : ''
            };
          }, true);

          // save the form to the note
          scope.$on('save', function(event, note) {
            event.stopPropagation();
            note.subject = scope.form.subject;
            note.text = scope.form.text;
{'fraction_non_alphanumeric': 0.13592750533049042, 'fraction_numerical': 0.0, 'mean_word_length': 1.6511299435028248, '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': '7246450', 'n_tokens_mistral': 514, 'n_tokens_neox': 511, 'n_words': 106}