fiddle here http://jsfiddle.net/prantikv/dJty6/36/
I have data from json so that
$scope.info={ "company1":"this", "company2":"is", "company3":"sparta" }
I use ng-repeat to print all the data, and I want a monotory for field changes.
<input type="text" ng-repeat="item in info" value="{{item}}" monitor-change>
I have a monitorChange directive:
.directive('monitorChange', function() { return { restrict: 'A', scope: {changedFlag: '='}, link: function(scope, element, attrs) { var $el = angular.element(element); $el.on('keyup', function() {
When I try to change the data, I get the error message Error: [$compile:nonassign] Expression 'undefined' used with directive 'monitorChange' is non-assignable!
I print the data in my view with:
{{changedFlag }}
What is wrong with the code?
source share