Q: Angular JS keep initial value of model in a attribute I have implemented notify property changed event in angular JS by using $watch. whenever changing the model I am getting the old value and newvalue in $watch function as i expected. But the issue is when i load the data initial time,  i have binded employee.firstname property to a new attribute named oldvalue. when i change the value of a control the oldvalue is also getting changed. How can i restrict changing the initial value from oldvalue attribute.
angular.module('app', []);
angular.module('app').controller('ctrl', function ($scope) {
    $scope.size = 100;
    var employee = {
        "employees": [
        { "firstName": "John", "lastName": "Doe" },
        { "firstName": "Anna", "lastName": "Smith" },
        { "firstName": "Peter", "lastName": "Jones" }
        ]
    };
    $scope.employees = employee;
});

angular.module('app').directive('notifypropertychanged', function () {
    return {
        link: function (scope, el, attrs) {
            scope.$watch(attrs['notifypropertychanged'], function (newVal, oldVal) {

                var entity = attrs['entity'];
                el.css('height', newVal + 'px');
            });
        } 
    }
});

<body ng-controller="ctrl">

  <input ng-repeat="emp in employees.employees" 
    oldvalue="{{emp.firstName}}" entity="entity{{$index}}" 
    ng-model="emp.firstName" notifypropertychanged="emp.firstName" />
</body>

