How to use the formiojs.setAppUrl 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 / modules / resource / resource.service.ts View on Github external
constructor(
        public appConfig: FormioAppConfig,
        public config: FormioResourceConfig,
        public loader: FormioLoader,
        @Optional() public resourcesService: FormioResources
    ) {
        if (this.appConfig && this.appConfig.appUrl) {
            Formio.setBaseUrl(this.appConfig.apiUrl);
            Formio.setAppUrl(this.appConfig.appUrl);
            Formio.formOnly = this.appConfig.formOnly;
        }
        else {
            console.error('You must provide an AppConfig within your application!');
        }

        // Create the form url and load the resources.
        this.formUrl = this.appConfig.appUrl + '/' + this.config.form;
        this.initialize();
    }
github formio / angular-formio / dist / modules / resource / resource.service.js View on Github external
function FormioResourceService(appConfig, config, loader, resourcesService) {
        var _this = this;
        this.appConfig = appConfig;
        this.config = config;
        this.loader = loader;
        this.resourcesService = resourcesService;
        if (this.appConfig && this.appConfig.appUrl) {
            Formio.setBaseUrl(this.appConfig.apiUrl);
            Formio.setAppUrl(this.appConfig.appUrl);
            Formio.formOnly = this.appConfig.formOnly;
        }
        else {
            console.error('You must provide an AppConfig within your application!');
        }
        // Add this resource service to the list of all resources in context.
        if (this.resourcesService) {
            this.resourcesService.resources[this.config.name] = this;
            this.resources = this.resourcesService.resources;
        }
        // Create the form url and load the resources.
        this.formUrl = this.appConfig.appUrl + '/' + this.config.form;
        this.onParents = new core_1.EventEmitter();
        this.onIndexSelect = new core_1.EventEmitter();
        this.refresh = new core_1.EventEmitter();
        this.resource = { data: {} };
github formio / angular-formio / dist / modules / auth / auth.service.js View on Github external
function FormioAuthService(appConfig, config) {
        var _this = this;
        this.appConfig = appConfig;
        this.config = config;
        this.authenticated = false;
        this.formAccess = {};
        this.submissionAccess = {};
        this.is = {};
        this.user = null;
        if (this.appConfig && this.appConfig.appUrl) {
            Formio.setBaseUrl(this.appConfig.apiUrl);
            Formio.setAppUrl(this.appConfig.appUrl);
            Formio.formOnly = !!this.appConfig.formOnly;
        }
        else {
            console.error('You must provide an AppConfig within your application!');
        }
        this.loginForm = this.appConfig.appUrl + '/' + this.config.login.form;
        this.registerForm = this.appConfig.appUrl + '/' + this.config.register.form;
        this.onLogin = new core_1.EventEmitter();
        this.onLogout = new core_1.EventEmitter();
        this.onRegister = new core_1.EventEmitter();
        this.onUser = new core_1.EventEmitter();
        this.onError = new core_1.EventEmitter();
        this.ready = new Promise(function (resolve, reject) {
            _this.readyResolve = resolve;
            _this.readyReject = reject;
        });
github formio / angular-formio / src / modules / auth / auth.service.ts View on Github external
constructor(
      public appConfig: FormioAppConfig,
      public config: FormioAuthConfig
  ) {
    this.user = null;

    if (this.appConfig && this.appConfig.appUrl) {
      Formio.setBaseUrl(this.appConfig.apiUrl);
      Formio.setAppUrl(this.appConfig.appUrl);
      Formio.formOnly = !!this.appConfig.formOnly;
    }
    else {
      console.error('You must provide an AppConfig within your application!');
    }

    this.loginForm = this.appConfig.appUrl + '/' + this.config.login.form;
    this.registerForm = this.appConfig.appUrl + '/' + this.config.register.form;
    this.onLogin = new EventEmitter();
    this.onLogout = new EventEmitter();
    this.onRegister = new EventEmitter();
    this.onUser = new EventEmitter();
    this.onError = new EventEmitter();

    this.ready = new Promise((resolve: any, reject: any) => {
      this.readyResolve = resolve;