JSFiddle - React, Tailwind, and code Playground
HTML
<div ng-app="testmod">
<div ng-controller="TestCtrl">
<test-directive obj="obj" ng-repeat="obj in objects">
</test-directive>
<button ng-click="objects.push({title:'nope'})">Verify</button>
</div>
</div>
JavaScript
var app = angular.module('testmod', []);
app.controller('TestCtrl', function($scope) {
$scope.objects = [
{unchanged:true, title:'Is not changed'},
{unchanged:true, title: 'Is also not changed'}
];
});
app.directive('testDirective', function() {
return {
restrict: 'E',
scope: { obj: '=' },
template: '<div><a ng-click="doTheThing()">{{obj.title}}</a></div>',
link: function($scope, $element, $attrs) {
$scope.doTheThing = function() {
$scope.obj = { changed: true, title: 'Is changed.'};
};
}
};
});