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
  • 6,685
  • 11
  • 49
  • 111

0 Answers0