### Angular function

# submit source

  Submit function is generic function for submiting forms.

  - redirectTo param is used for redirect if return value will be evaluated in a new page.
  - In case of unformatted date object in any key recursively, it must be converted by convertDate function.
  - ListNode and Node objects get seperated from model in {@link prepareFormItems module:ulakbus.formService.function:prepareFormItems} They must be concat to model key of scope first.
  - Backend API waits form as model value. So `data.form` key must be set to `$scope.model`
  - Other parameters we pass to backend API are shown in the example below

        var data = {
                      "form": $scope.model,
                      "token": $scope.token,
                      "model": $scope.form_params.model,
                      "cmd": $scope.form_params.cmd,
                      "flow": $scope.form_params.flow,
                      "object_id": $scope.object_id,
                      "filter": $scope.filter,
                      "query": $scope.form_params.query
                  };

    ### Special response object process

  - If response object is a downloadable pdf file, checking from headers `headers('content-type') === "application/pdf"` download using Blob object.

  ##### Dependencies:

  Name | Type | Description
  --- | --- | ---
  $scope | Object |
  redirectTo | Object |