本文整理匯總了TypeScript中@ngrx/router.QueryParams.pluck方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript QueryParams.pluck方法的具體用法?TypeScript QueryParams.pluck怎麽用?TypeScript QueryParams.pluck使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類@ngrx/router.QueryParams
的用法示例。
在下文中一共展示了QueryParams.pluck方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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;
}
)
;
}
示例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();
}
)
;
}
示例3: 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();
}
)
;
}
示例4: 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();
}
)
;
}