• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript basket.service.BasketService类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: toggleBasketEntry

 toggleBasketEntry() {
     if (this.isRecordSelected) {
         return this.basket.addRecordIds([this.summary.id]);
     } else {
         return this.basket.removeRecordIds([this.summary.id]);
     }
 }
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:7,代码来源:record.component.ts


示例2: ngOnInit

    ngOnInit() {
        // A SearchContext provides all the data needed for browse.
        this.staffCat.createContext();

        // Cache the basket on page load.
        this.basket.getRecordIds();

        this.searchForm.searchTab = 'browse';
    }
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:9,代码来源:browse.component.ts


示例3: ngOnInit

    ngOnInit() {
        // Create the search context that will be used by all of my
        // child components.  After initial creation, the context is
        // reset and updated as needed to apply new search parameters.
        this.staffCat.createContext();

        // Cache the basket on page load.
        this.basket.getRecordIds();
    }
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:9,代码来源:catalog.component.ts


示例4: ngOnInit

    ngOnInit() {
        this.searchContext = this.staffCat.searchContext;
        this.summary.getHoldCount();
        this.isRecordSelected = this.basket.hasRecordId(this.summary.id);

        // Watch for basket changes caused by other components
        this.basketSub = this.basket.onChange.subscribe(() => {
            this.isRecordSelected = this.basket.hasRecordId(this.summary.id);
        });
    }
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:10,代码来源:record.component.ts


示例5:

 this.basketSub = this.basket.onChange.subscribe(() => {
     this.isRecordSelected = this.basket.hasRecordId(this.summary.id);
 });
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:3,代码来源:record.component.ts


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


示例7: basketCount

 basketCount(): number {
     return this.basket.recordCount();
 }
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:3,代码来源:basket-actions.component.ts



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript bib-record.service.BibRecordService类代码示例发布时间:2022-05-28
下一篇:
TypeScript store.service.StoreService类代码示例发布时间:2022-05-28
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap