So i have this simple listing of system users (attached screenshot), client can edit the users or create new user and a new panel is displayed accordingly.

![enter image description here](https://i.stack.imgur.com/Y0VJs.jpg)
![enter image description here](https://i.stack.imgur.com/xwrbB.jpg)

What I'm doing is updating the different fields of the edit/create form depending on the user action. But since im coming from a Backbone background, the usual way I would do something like this is to create a new view, initialize it with a parameter indicating whether it's a create or edit mode, and then destroy this view when clicking on cancel/save changes/create user. But right now im just depending on angular event binding to update the same form elements, is this the proper way to do it in angular?

```
$scope.prepare_form = function (user_id) {

    if (user_id) {
        // edit mode
        var user = filterFilter($scope.users, { id: user_id })[0];

        $scope.fdata_create.name = user.name;
        $scope.fdata_create.email = user.email;
        $scope.fdata_create.role_name = user.role_name;
        $scope.fdata_create.id = user.id;
    } else {
        // create mode
        $scope.fdata_create.name = '';
        $scope.fdata_create.email = '';
        $scope.fdata_create.role_name = '';
        $scope.fdata_create.id = '';
    }

    $scope.form_create_open = true;

}

```