當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript ParamMap.get方法代碼示例

本文整理匯總了TypeScript中@angular/router.ParamMap.get方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript ParamMap.get方法的具體用法?TypeScript ParamMap.get怎麽用?TypeScript ParamMap.get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在@angular/router.ParamMap的用法示例。


在下文中一共展示了ParamMap.get方法的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:

 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

示例5:

 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

示例6: 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

示例7: 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

示例8: 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

示例9:

				( 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

示例10: 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


注:本文中的@angular/router.ParamMap.get方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。