How to use the urijs.expand function in urijs

To help you get started, we’ve selected a few urijs 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 openshift / origin-web-catalog / src / components / create-from-builder / create-from-builder.controller.ts View on Github external
public navigateToAdvancedForm() {
    let template = 'project/{project}/create/fromimage?' +
      'imageStream={imageStream}&' +
      'imageTag={imageTag}&' +
      'namespace={namespace}&' +
      'displayName={displayName}&' +
      'name={name}&' +
      'sourceURI={sourceURI}&' +
      'sourceRef={sourceRef}&' +
      'contextDir={contextDir}&' +
      'advanced=true';
    let target = URI.expand(template, {
      project: this.ctrl.selectedProject.metadata.name,
      imageStream: this.ctrl.imageStream.resource.metadata.name,
      imageTag: this.ctrl.istag.name,
      namespace: this.ctrl.imageStream.resource.metadata.namespace,
      displayName: this.ctrl.imageStream.name,
      name: this.ctrl.name || '',
      sourceURI: this.ctrl.repository || '',
      sourceRef: this.gitRef || '',
      contextDir: this.contextDir || ''
    }).toString();

    // TODO: Handle configurable base URLs.
    // let base = 'https://localhost:9000/dev-console/';
    // if (base) {
    //   window.location.href = base + target;
    //   return;