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


TypeScript store.service.StoreService类代码示例

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


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

示例1: ngOnInit

    ngOnInit() {
        this.searchContext = this.staffCat.searchContext;

        this.defaultTab =
            this.store.getLocalItem('eg.cat.default_record_tab')
            || 'catalog';

        // Watch for URL record ID changes
        // This includes the initial route.
        // When applying the default configured tab, no navigation occurs
        // to apply the tab name to the URL, it displays as the default.
        // This is done so no intermediate redirect is required, which
        // messes with browser back/forward navigation.
        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,代码行数:25,代码来源:record.component.ts

示例2: open

    async open(args: NgbModalOptions): Promise<boolean> {
        this.holdIds = [].concat(this.holdIds); // array-ify ints

        this.transferTarget =
            this.store.getLocalItem('eg.circ.hold.title_transfer_target');

        if (!this.transferTarget) {
            this.toast.warning(await this.targetNeeded.current());
            return Promise.reject('Transfer Target Required');
        }

        return super.open(args);
    }
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:13,代码来源:transfer-dialog.component.ts

示例3: reprintLast

    reprintLast() {
        const prev = this.store.getLocalItem('eg.print.last_printed');

        if (prev) {
            const req: PrintRequest = {
                text: prev.content,
                printContext: prev.context || 'default',
                contentType: prev.content_type || 'text/html',
                showDialog: Boolean(prev.show_dialog)
            };

            this.print(req);
        }
    }
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:14,代码来源:print.service.ts

示例4: getRecordIds

    // TODO: Add server-side API for sorting a set of bibs by ID.
    // See EGCatLoader/Container::fetch_mylist
    getRecordIds(): Promise<number[]> {
        const cacheKey = this.store.getLoginSessionItem(BASKET_CACHE_KEY_COOKIE);
        this.idList = [];

        if (!cacheKey) { return Promise.resolve(this.idList); }

        return this.anonCache.getItem(cacheKey, BASKET_CACHE_ATTR).then(
            list => {
                if (!list) { return this.idList; }
                this.idList = list.map(id => Number(id));
                return this.idList;
            }
        );
    }
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:16,代码来源:basket.service.ts

示例5: setRecordIds

    setRecordIds(ids: number[]): Promise<number[]> {
        this.idList = ids;

        // If we have no cache key, that's OK, assume this is the first
        // attempt at adding a value and let the server create the cache
        // key for us, then store the value in our cookie.
        const cacheKey = this.store.getLoginSessionItem(BASKET_CACHE_KEY_COOKIE);

        return this.anonCache.setItem(cacheKey, BASKET_CACHE_ATTR, this.idList)
        .then(key => {
            this.store.setLoginSessionItem(BASKET_CACHE_KEY_COOKIE, key);
            this.onChange.emit(this.idList);
            return this.idList;
        });
    }
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:15,代码来源:basket.service.ts

示例6: dispatchPrint

    dispatchPrint(printReq: PrintRequest) {

        if (!printReq.text) {
            // Sometimes the results come from an externally-parsed HTML
            // template, other times they come from an in-page template.
            printReq.text = this.elm.nativeElement.innerHTML;
        }

        // Retain a copy of each printed document in localStorage
        // so it may be reprinted.
        this.store.setLocalItem('eg.print.last_printed', {
            content: printReq.text,
            context: printReq.printContext,
            content_type: printReq.contentType,
            show_dialog: printReq.showDialog
        });

        if (this.useHatch()) {
            this.printViaHatch(printReq);
        } else {
            // Here the needed HTML is already in the page.
            window.print();
        }
    }
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:24,代码来源:print.component.ts

示例7: useHatch

 useHatch(): boolean {
     return this.store.getLocalItem('eg.hatch.enable.printing')
         && this.hatch.connect();
 }
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:4,代码来源:print.component.ts

示例8:

 .then(key => {
     this.store.setLoginSessionItem(BASKET_CACHE_KEY_COOKIE, key);
     this.onChange.emit(this.idList);
     return this.idList;
 });
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:5,代码来源:basket.service.ts

示例9: setDefaultTab

 setDefaultTab() {
     this.defaultTab = this.recordTab;
     this.store.setLocalItem('eg.cat.default_record_tab', this.recordTab);
 }
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:4,代码来源:record.component.ts


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