How to use the @angular/router.convertToParamMap function in @angular/router

To help you get started, we’ve selected a few @angular/router 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 angular / angular / aio / content / examples / testing / src / testing / router-stubs.ts View on Github external
set testParamMap(params: {}) {
    this._testParamMap = convertToParamMap(params);
    this.subject.next(this._testParamMap);
  }
github DSpace / dspace-angular / src / app / shared / testing / active-router-stub.ts View on Github external
get snapshot() {
    return {
      params: this.testParams,
      queryParamMap: convertToParamMap(this.testParams)
    }
  }
}
github gentics / mesh-ui / src / testing / router-testing-mocks.ts View on Github external
setParamMap(params?: Params): void {
        this.paramMapSubject.next(convertToParamMap(params || {}));
    }
github ordercloud-api / ngx-shopper / src / UI / Buyer / src / app / checkout / containers / order-confirmation / order-confirmation.component.spec.ts View on Github external
it('should call OcLineItems.ListAll with order id param', () => {
      component.getLineItems().subscribe(() => {
        expect(appLineItemService.listAll).toHaveBeenCalledWith(mockOrderID);
      });
      paramMap.next(convertToParamMap({ orderID: mockOrderID }));
    });
  });
github unfetter-discover / unfetter-ui / src / app / settings / stix-objects / attack-patterns / attack-pattern-edit / attack-patterns-edit.component.spec.ts View on Github external
set testParamMap(params: {}) {
    this._testParamMap = convertToParamMap(params);
    this.subject.next(this._testParamMap);
  }
github opendigitaleducation / entcore / admin / src / main / ts / app / users / communication / user-groups.resolver.spec.ts View on Github external
function generateActivatedRouteSnapshot(userId?: string): ActivatedRouteSnapshot {
    return {paramMap: convertToParamMap({userId})} as ActivatedRouteSnapshot;
}
github fastlane / ci / web / app / project / project.component.spec.ts View on Github external
{
                path: 'project/:projectId/build/:buildId',
                component: DummyComponent
              },
              {
                path: '404',
                component: DummyComponent
              }
            ])
          ],
          declarations: [ProjectComponent, DummyComponent],
          providers: [
            {provide: DataService, useValue: dataService}, {
              provide: ActivatedRoute,
              useValue:
                  {paramMap: Observable.of(convertToParamMap({id: '123'}))}
            },
            {provide: MatDialog, useValue: dialog}
          ],
        })
        .compileComponents();

    fixture = TestBed.createComponent(ProjectComponent);
    fixtureEl = fixture.debugElement;
    component = fixture.componentInstance;

    location = TestBed.get(Location);
  }));
github Ninja-Squad / globe42 / frontend / src / app / spent-time-statistics / spent-time-statistics.component.spec.ts View on Github external
function createRoute(queryParams: {[key: string]: string}): ActivatedRoute {
  return {
    snapshot: {
      data: {
        users: [ { id: 1, login: 'jb' }, { id: 2, login: 'ced' } ]
      },
      queryParamMap: convertToParamMap(queryParams)
    }
  } as any;
}
github Ninja-Squad / ngx-speculoos / projects / ngx-speculoos / src / lib / route.ts View on Github external
root?: ActivatedRouteSnapshot;
  /** The parent of this route in the router state tree */
  parent?: ActivatedRouteSnapshot | null;
  /** The first child of this route in the router state tree */
  firstChild?: ActivatedRouteSnapshot | null;
  /** The children of this route in the router state tree */
  children?: ActivatedRouteSnapshot[];
  /** The path from the root of the router state tree to this route */
  pathFromRoot?: ActivatedRouteSnapshot[];
}): ActivatedRouteSnapshot {
  return {
    url: options.url,
    params: options.params,
    paramMap: options.params && convertToParamMap(options.params),
    queryParams: options.queryParams,
    queryParamMap: options.queryParams && convertToParamMap(options.queryParams),
    fragment: options.fragment,
    data: options.data,
    outlet: options.outlet,
    component: options.component,
    routeConfig: options.routeConfig,
    root: options.root,
    parent: options.parent,
    firstChild: options.firstChild,
    children: options.children,
    pathFromRoot: options.pathFromRoot
  } as ActivatedRouteSnapshot;
}
github Ninja-Squad / ngx-speculoos / projects / ngx-speculoos / src / lib / route.ts View on Github external
routeConfig?: Route;
  /** The root of the router state */
  root?: ActivatedRouteSnapshot;
  /** The parent of this route in the router state tree */
  parent?: ActivatedRouteSnapshot | null;
  /** The first child of this route in the router state tree */
  firstChild?: ActivatedRouteSnapshot | null;
  /** The children of this route in the router state tree */
  children?: ActivatedRouteSnapshot[];
  /** The path from the root of the router state tree to this route */
  pathFromRoot?: ActivatedRouteSnapshot[];
}): ActivatedRouteSnapshot {
  return {
    url: options.url,
    params: options.params,
    paramMap: options.params && convertToParamMap(options.params),
    queryParams: options.queryParams,
    queryParamMap: options.queryParams && convertToParamMap(options.queryParams),
    fragment: options.fragment,
    data: options.data,
    outlet: options.outlet,
    component: options.component,
    routeConfig: options.routeConfig,
    root: options.root,
    parent: options.parent,
    firstChild: options.firstChild,
    children: options.children,
    pathFromRoot: options.pathFromRoot
  } as ActivatedRouteSnapshot;
}