0

I have a service that returns dict. In my controller i set it to $scope variable:

.controller('viewCtrl', function($scope, myService) {
    $scope.mydict = myService.mydict;
}

But then when i change value in input:

<input ng-model="mydict.mykey">

mykey value changed in service myService.mydict too. But i want only change it in $scope.mydict variable.

I tried do this:

var localDict = myService.mydict;
$scope.mydict = localDict;

This didn't work. When use ng-value - then it doesn't track it after change.

Arti
  • 7,356
  • 12
  • 57
  • 122

0 Answers0