Q:

Same modal for creating and updating records on Angular (angular + bootstrap)

I have a modal that creates objects on a simple CRUD.
I wanted to reuse the same modal to Edit/Update records since the form is the same.
I have a ng-repeat directive to lay out the different object on bootstrap panels.
The problem is that when I click edit, the form gains the scope of the current object to edit but when I exit the form and click Add New, the same modal pops up with the scope of the previous object.
If I try to $scope.object = '', the two way data binding kicks in and it updates my model and resets the object values.
How can I reset the scope without resetting the object I previously edited?
Thanks

A:

Thank you, the answer was creating instances of the modal everytime I want to add or edit a request.

