code: function update(form) {
        // refuse to work with invalid data
        if (!vm.clientModelDoc._id || form && !form.$valid) {
          return;
        }
  
        ClientModelDocService.update(vm.clientModelDoc)
          .then(updateClientModelDocSuccess)
          .catch(updateClientModelDocCatch);
  
        function updateClientModelDocSuccess(updatedClientModelDoc) {
          // update the display name after successful save
          vm.displayName = updatedClientModelDoc.name;
          Toast.show({text: 'ClientModelDoc ' + vm.displayName + ' updated'});
          if (form) {
            form.$setPristine();
          }
        }
  
        function updateClientModelDocCatch(err) {
          Toast.show({
            type: 'warn',
            text: 'Error while updating ClientModelDoc ' + vm.displayName,
            link: {state: $state.$current, params: $stateParams}
          });
  
          if (form && err) {
            form.setResponseErrors(err.data);
          }
        }
      }
docs: Updates a clientModelDoc by using the ClientModelDocService save method
  @param {Form} [form]