当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript router.ParamMap类代码示例

本文整理汇总了TypeScript中@angular/router.ParamMap的典型用法代码示例。如果您正苦于以下问题:TypeScript ParamMap类的具体用法?TypeScript ParamMap怎么用?TypeScript ParamMap使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ParamMap类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1:

			( paramMap: ParamMap ) : void => {

					this.filterText = ( paramMap.get( "filterText" ) || "" );
					this.filterType = ( paramMap.get( "filterType" ) || "active" );
					this.applyFilterToList();

				}
开发者ID:bennadel,项目名称:JavaScript-Demos,代码行数:7,代码来源:screens-view.component.ts

示例2:

        this.route.paramMap.subscribe((params: ParamMap) => {
            this.recordTab = params.get('tab');
            this.recordId = +params.get('id');
            this.searchContext = this.staffCat.searchContext;

            if (!this.recordTab) {
                this.recordTab = this.defaultTab || 'catalog';
            }

            this.loadRecord();
        });
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:11,代码来源:record.component.ts

示例3:

				( paramMap: ParamMap ) : void => {

					console.warn( "Param-map value:", paramMap.get( "id" ) );

					if ( paramMap.get( "id" ) === "3" ) {

						console.warn( "Navigating back to root." );
						this.router.navigate( [ "/" ] );
						
					}
					
				}
开发者ID:bennadel,项目名称:JavaScript-Demos,代码行数:12,代码来源:good-child.component.ts

示例4: setTimeout

			( params: ParamMap ) : void => {

				console.log( "Parent ID changed:", params.get( "id" ) );

				this.id = params.get( "id" );
				
				// Simulate loading the data from some external service.
				this.isLoading = true;
				this.timer = this.timer = setTimeout(
					() : void => {

						this.isLoading = false;

					},
					1000
				);

			}
开发者ID:bennadel,项目名称:JavaScript-Demos,代码行数:18,代码来源:parent.component.ts

示例5: switchMap

  switchMap((params: ParamMap) => {
     const gamenr = params.get('gamenr')
     this.logger.debug(`extracted ${gamenr}`)
     if(gamenr){
       return this.betterdb.getGameWithBetsForUsers(parseInt(gamenr))
     } else {
       //TODO: maybe redirect
       return EMPTY
     }
 }))
开发者ID:idot,项目名称:betterplay,代码行数:10,代码来源:game-edit.component.ts

示例6: incrementHitCount

    route.paramMap.subscribe(async (params: ParamMap) => {
      // short param is definitely defined because we can only here from the
      // route with short defined
      const short = params.get('short') as string;
      const snapshot =
          (await db.collection('links').doc<Link>(short).ref.get());
      const dest = snapshot.data() as Link | undefined;

      if (dest !== undefined) {
        const incrementHitCount =
            fns.httpsCallable<string, void>('callableIncrementHitCount');
        incrementHitCount(short);
        window.location.replace(dest.content);
      } else {
        window.location.replace(environment.baseUrl);
      }
    });
开发者ID:brikr,项目名称:bthles,代码行数:17,代码来源:link-content.component.ts

示例7: applyUrlParams

    applyUrlParams(context: CatalogSearchContext, params: ParamMap): void {

        // Reset query/filter args.  The will be reconstructed below.
        context.reset();

        // These fields can be copied directly into place
        ['format', 'sort', 'available', 'global', 'identQuery', 'identQueryType']
        .forEach(field => {
            const val = params.get(field);
            if (val !== null) {
                context[field] = val;
            }
        });

        if (params.get('limit')) {
            context.pager.limit = +params.get('limit');
        }

        if (params.get('offset')) {
            context.pager.offset = +params.get('offset');
        }

        ['query', 'fieldClass', 'joinOp', 'matchOp'].forEach(field => {
            const arr = params.getAll(field);
            if (arr && arr.length) {
                context[field] = arr;
            }
        });

        CATALOG_CCVM_FILTERS.forEach(code => {
            const val = params.get(code);
            if (val) {
                context.ccvmFilters[code] = val.split(/,/);
            } else {
                context.ccvmFilters[code] = [''];
            }
        });

        params.getAll('facets').forEach(blob => {
            const facet = JSON.parse(blob);
            context.addFacet(new FacetFilter(facet.c, facet.n, facet.v));
        });

        if (params.get('org')) {
            context.searchOrg = this.org.get(+params.get('org'));
        }
    }
开发者ID:jamesrf,项目名称:Evergreen,代码行数:47,代码来源:catalog-url.service.ts

示例8:

				( paramMap: ParamMap ) : void => {

					this.projectType = ( paramMap.get( "projectType" ) || null );

					// When switching the project type, we need to reset the options.
					this.selectedOption = "";
					this.options = [];

					switch ( this.projectType ) {
						case "board":
							this.options = [ "Masonry", "Meticulous", "Grid" ];
						break;
						case "prototype":
							this.options = [ "Desktop (Web)", "iPad", "Android Tablet", "iPhone", "Android Phone", "Apple Watch", "Android Watch" ];
						break;
					}

				}
开发者ID:bennadel,项目名称:JavaScript-Demos,代码行数:18,代码来源:create-project-view.component.ts

示例9:

 CATALOG_CCVM_FILTERS.forEach(code => {
     const ccvmVal = params.get(code);
     if (ccvmVal) {
         ts.ccvmFilters[code] = ccvmVal.split(/,/);
     } else {
         ts.ccvmFilters[code] = [''];
     }
 });
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:8,代码来源:catalog-url.service.ts

示例10:

 CATALOG_CCVM_FILTERS.forEach(code => {
     const val = params.get(code);
     if (val) {
         context.ccvmFilters[code] = val.split(/,/);
     } else {
         context.ccvmFilters[code] = [''];
     }
 });
开发者ID:jamesrf,项目名称:Evergreen,代码行数:8,代码来源:catalog-url.service.ts


注:本文中的@angular/router.ParamMap类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。