V
V
Vassa2014-05-14 11:07:09
Angular
Vassa, 2014-05-14 11:07:09

How to reset $scope to initial state?

Resetting $scope to the initial state it was in when it was initialized.
Those. I have a modal window that has its own $scope+controller, how can I force reset the entire $scope to its original state after some manipulations with it?
$scope+controller should look like it was just initialized.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
TekVanDo, 2014-05-14
@TekVanDo

create a clone $scope during initialization and, if necessary, replace the controller's $scope with it
Example:
codepen.io/Tek/pen/EioKI?editors=101

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question