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


TypeScript router.QueryParams類代碼示例

本文整理匯總了TypeScript中@ngrx/router.QueryParams的典型用法代碼示例。如果您正苦於以下問題:TypeScript QueryParams類的具體用法?TypeScript QueryParams怎麽用?TypeScript QueryParams使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了QueryParams類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: ngOnInit

	// I get called once after the component has been instantiated and the inputs have
	// been bound for the first time.
	public ngOnInit() : void {

		this.isLoading = true;
		this.projectService.getProjects().subscribe(
			( projects: IProject[] ) : void => {

				this.isLoading = false;
				this.projects = projects;

			}
		);

		this.queryParamsSubscription = this.queryParams
			.pluck<string>( "inboxProjectId" )
			.distinctUntilChanged()
			.subscribe(
				( value: string ) : void => {

					this.projectId = +value;

				}
			)
		;

	}
開發者ID:bennadel,項目名稱:JavaScript-Demos,代碼行數:27,代碼來源:inboxes-view.component.ts

示例2: ngOnInit

	// I get called once when the component has been instantiated, after the inputs have
	// been bound for the first time.
	public ngOnInit() : void {

		this.queryParamsSubscription = this.queryParams
			.pluck<string>( "filter" )
			.distinctUntilChanged()
			.filter(
				( filter: string ) : boolean => {

					return( this.filter !== ( filter || "" ) );

				}
			)
			.subscribe(
				( filter: string ) : void => {

					this.filter = ( filter || "" );
					this.applyFilter();

				}
			)
		;

		this.routeParamsSubscription = this.routeParams
			.pluck<string>( "projectId" )
			.distinctUntilChanged()
			.switchMap(
				( value: string ) : Observable<IScreen[]> => {

					this.isLoading = true;

					return( this.screenService.getScreensByProjectId( +value ) );

				}
			)
			.subscribe(
				( screens: IScreen[] ) : void => {

					this.isLoading = false;
					this.screens = screens;
					this.filteredScreens = this.screens.map(
						( screen: IScreen ) : IFilteredScreen => {

							return({
								screen: screen,
								tags: [ screen.name.toLowerCase(), screen.filename.toLowerCase() ],
								visible: false,
								column: 0
							});

						}
					);

					this.applyFilter();

				}
			)
		;

	}
開發者ID:bennadel,項目名稱:JavaScript-Demos,代碼行數:61,代碼來源:screens-view.component.ts

示例3: ngOnInit

	// I get called once after the component has been instantiated and the inputs have
	// been bound for the first time.
	public ngOnInit() : void {

		this.queryParamsSubscription = this.queryParams.subscribe(
			( params: any ) : void => {

				this.projectId = ( +params[ "inboxProjectId" ] || 0 );
				this.conversationId = ( +params[ "inboxConversationId" ] || 0 );

			}
		);

	}
開發者ID:bennadel,項目名稱:JavaScript-Demos,代碼行數:14,代碼來源:conversation-view.component.ts

示例4: ngOnInit

	// I get called once after the component has been instantiated and the inputs have
	// been bound for the first time.
	public ngOnInit() : void {

		this.queryParams.subscribe(
			( params ) : void => {

				this.isShowingInbox = ( params[ "inbox" ] === "true" );
				this.projectId = ( +params[ "inboxProjectId" ] || 0 );
				this.conversationId = ( +params[ "inboxConversationId" ] || 0 );

			}
		);

	}
開發者ID:bennadel,項目名稱:JavaScript-Demos,代碼行數:15,代碼來源:inbox.component.ts

示例5: ngOnInit

	// I get called once when the component has been instantiated, after the inputs have
	// been bound for the first time.
	public ngOnInit() : void {

		this.queryParamSubscription = this.queryParams.pluck<string>( "filter" )
			.filter(
				( filter: string ) : boolean => {

					return( this.filter !== ( filter || "" ) );

				}
			)
			.subscribe(
				( filter: string ) : void => {

					this.filter = ( filter || "" );
					this.applyFilter();

				}
			)
		;


		this.isLoading = true;

		this.boardSubscription = this.boardService
			.getBoards()
			.subscribe(
				( boards: IBoard[] ) : void => {

					this.isLoading = false;
					this.boards = boards;
					this.filteredBoards = this.boards.map(
						( board: IBoard ) : IFilteredBoard => {

							return({
								board: board,
								tags: [ board.name.toLowerCase() ],
								visible: false,
								column: 0
							});

						}
					);

					this.applyFilter();

				}
			)
		;
		
	}
開發者ID:bennadel,項目名稱:JavaScript-Demos,代碼行數:52,代碼來源:boards-view.component.ts

示例6: ngOnInit

	// I get called once when the component has been instantiated, after the inputs have
	// been bound for the first time.
	public ngOnInit() : void {

		this.queryParamSubscription = this.queryParams.pluck<string>( "filter" )
			.filter(
				( filter: string ) : boolean => {

					return( this.filter !== ( filter || "" ) );

				}
			)
			.subscribe(
				( filter: string ) : void => {

					this.filter = ( filter || "" );
					this.applyFilter();

				}
			)
		;


		this.isLoading = true;

		this.projectSubscription = this.projectService
			.getProjects()
			.subscribe(
				( projects: IProject[] ) : void => {

					this.isLoading = false;
					this.projects = projects;
					this.filteredProjects = this.projects.map(
						( project: IProject ) : IFilteredProject => {

							return({
								project: project,
								tags: [ project.name.toLowerCase() ],
								visible: false,
								column: 0
							});

						}
					);

					this.applyFilter();

				}
			)
		;
		
	}
開發者ID:bennadel,項目名稱:JavaScript-Demos,代碼行數:52,代碼來源:list-view.component.ts


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