I am trying to create new object that will have some default values from scope.
I found there is copy function to create new independent object.
angular.copy(source,destication)
But its not working for me. I get undefined when I console new object.
angular.copy($rootScope.answers,$rootScope.default);
console.log($rootScope.answers);
console.log($rootScope.default);
https://plnkr.co/edit/BFGXr7LNAe0KvQipj9JJ?p=preview
In app.js in .run method I trying to use copy function. Please let me know if I am missing anything.
Object.assign({}, source)