<commit_before>﻿function Meganav($scope, dialogService, meganavResource) {

    $scope.items = [];

    if ($scope.model.value) {
        // retreive the saved items
        $scope.items = $scope.model.value;

        // get updated entities for content
        getItemEntities($scope.items);
    }

    $scope.edit = function (item) {
        dialogService.linkPicker({
            currentTarget: item,
            callback: function (item) {
                item = buildNavItem(item);
            }
        });
    };

    $scope.remove = function (item) {
        item.remove();
    };

    $scope.$on("formSubmitting", function (ev, args) {
        $scope.model.value = $scope.items;
    });
<commit_msg>Update item value via extend to maintain reference to original object<commit_after>﻿function Meganav($scope, dialogService, meganavResource) {

    $scope.items = [];

    if ($scope.model.value) {
        // retreive the saved items
        $scope.items = $scope.model.value;

        // get updated entities for content
        getItemEntities($scope.items);
    }

    $scope.edit = function (item) {
        dialogService.linkPicker({
            currentTarget: item,
            callback: function (item) {
                angular.extend(item, buildNavItem(data));
            }
        });
    };

    $scope.remove = function (item) {
        item.remove();
    };

    $scope.$on("formSubmitting", function (ev, args) {
        $scope.model.value = $scope.items;
    });

{'fraction_non_alphanumeric': 0.1324815063887021, 'fraction_numerical': 0.0, 'mean_word_length': 2.055441478439425, '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': '3438099', 'n_tokens_mistral': 431, 'n_tokens_neox': 414, 'n_words': 90}