 
 
     $scope.save = (model) ->
-        console.log($scope.form)
-        user_copy = Restangular.copy($scope.user)
+
+        user_copy = RestangularV2.copy($scope.user)
 
         if user_copy.profile.photo
           delete user_copy.profile.photo

)


.controller('CivilStatusController', ($rootScope, $scope, $state, $filter, ISO3166, Restangular, Upload) ->

  if(!$scope.isAuthenticated)
    $state.go("candidature")


    $scope.save = (model) ->
      # console.log($scope.form)
      model_copy =  RestangularV2.copy(model)

      if model.profile.birthdate
        model_copy.profile.birthdate = $filter('date')(model.profile.birthdate, 'yyyy-MM-dd')
