How to use the formiojs.Formio function in formiojs

To help you get started, we’ve selected a few formiojs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github formio / angular-formio / src / grid / grid.component.ts View on Github external
loadGrid(src?: string) {
    // If no source is provided, then skip.
    if (!src && !this.formio) {
      return;
    }
    // Do not double load.
    if (this.formio && this.src && (src === this.src)) {
      return;
    }

    if (src) {
      this.src = src;
      this.formio = new Formio(this.src, { formOnly: true });
    }

    // Load the header.
    this.header.load(this.formio)
      .then(() => this.setPage(0))
      .catch(error => this.onError(error));
  }
github formio / angular-formio / src / resource / resource.service.ts View on Github external
setContext(route: ActivatedRoute) {
    this.resourceId = route.snapshot.params['id'];
    this.resource = { data: {} };
    this.resourceUrl = this.appConfig.appUrl + '/' + this.config.form;
    if (this.resourceId) {
      this.resourceUrl += '/submission/' + this.resourceId;
    }
    this.formio = new Formio(this.resourceUrl);
    if (this.resourcesService) {
      this.resources[this.config.name] = this;
    }
    this.loadParents();
  }
github formio / angular-formio / src / manager / form-manager.service.ts View on Github external
reset(route?: ActivatedRoute) {
    if (route) {
      route.params.subscribe(params => {
        if (params.id) {
          this.formio = new Formio(`${this.formio.formsUrl}/${params.id}`);
        } else {
          this.reset();
        }
      });
    } else {
      this.formio = new Formio(this.appConfig.appUrl);
      this.setAccess();
    }
  }
github formio / ngFormio / src / directives / formioDelete.js View on Github external
$scope.$watch('src', (src) => {
          if (!src) { return; }
          $scope.formio = new Formio(src);
          resourceName = $scope.formio.submissionId ? 'submission' : 'form';
          var resourceTitle = resourceName.charAt(0).toUpperCase() + resourceName.slice(1);
          methodName = 'delete' + resourceTitle;
          $scope.deleteMessage = $scope.message || 'Are you sure you wish to delete the ' + resourceName + '?';
        });
github formio / angular-formio / src / manager / form-manager.service.ts View on Github external
route.params.subscribe(params => {
        if (params.id) {
          this.formio = new Formio(`${this.formio.formsUrl}/${params.id}`);
        } else {
          this.reset();
        }
      });
    } else {
github formio / angular-formio / src / formio.service.ts View on Github external
constructor(public url: string, public options?: object) {
    this.formio = new Formio(this.url, this.options);
  }
  requestWrapper(fn: any) {