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


TypeScript service.BasketService.removeAllRecordIds方法代码示例

本文整理汇总了TypeScript中@eg/share/catalog/basket.service.BasketService.removeAllRecordIds方法的典型用法代码示例。如果您正苦于以下问题:TypeScript service.BasketService.removeAllRecordIds方法的具体用法?TypeScript service.BasketService.removeAllRecordIds怎么用?TypeScript service.BasketService.removeAllRecordIds使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在@eg/share/catalog/basket.service.BasketService的用法示例。


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

示例1: applyAction

    applyAction() {
        console.debug('Performing basket action', this.basketAction);

        switch (this.basketAction) {
            case 'view':
                // This does not propagate search params -- unclear if needed.
                this.router.navigate(['/staff/catalog/search'],
                    {queryParams: {showBasket: true}});
                break;

            case 'clear':
                this.basket.removeAllRecordIds();
                break;

            case 'hold':
                this.basket.getRecordIds().then(ids => {
                    this.router.navigate(['/staff/catalog/hold/T'],
                        {queryParams: {target: ids}});
                });
                break;

            case 'print':
                this.basket.getRecordIds().then(ids => {
                    this.net.request(
                        'open-ils.search',
                        'open-ils.search.biblio.record.print', ids
                    ).subscribe(
                        at_event => {
                            // check for event..
                            const html = at_event.template_output().data();
                            this.printer.print({
                                text: html,
                                printContext: 'default'
                            });
                        }
                    );
                });
                break;

            case 'email':
                this.basket.getRecordIds().then(ids => {
                    this.net.request(
                        'open-ils.search',
                        'open-ils.search.biblio.record.email',
                        this.auth.token(), ids
                    ).toPromise(); // fire-and-forget
                });
                break;

            case 'bucket':
                this.basket.getRecordIds().then(ids => {
                    this.addToBucketDialog.recordId = ids;
                    this.addToBucketDialog.open({size: 'lg'});
                });
                break;

        }

        // Resetting basketAction inside its onchange handler
        // prevents the new value from propagating to Angular
        // Reset after the current thread.
        setTimeout(() => this.basketAction = ''); // reset
    }
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:63,代码来源:basket-actions.component.ts


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