将库分发到其他计算机时,A​​ngular 6库找不到到node_modules的相对路径

时间:2018-12-17 04:22:35

标签: angular angular-akita

原始TypeScript文件

import { Injectable } from '@angular/core';
import { transaction, snapshotManager } from '@datorama/akita';
import { tap } from 'rxjs/operators';
import { Business, transformBusiness } from 'smb-sp-models/business';
import { BusinessStore } from './business.store';
import { BusinessDataService } from './business-data.service';


@Injectable({
providedIn: 'root'
})
export class BusinessService {

    constructor(
        private businessStore: BusinessStore,
        private businessDataService: BusinessDataService
    ) {        
    }

    setQueryString(query: string) {
        this.businessDataService.setQueryString(query);
    }

    get() {
        return this.businessDataService.get().pipe(tap( (data: any) => {
            this.businessStore.set(data.data);
        }));
    }

    getById(id: string) {
        return this.businessDataService.getById(id).pipe(tap( (data: any) => {
            const entity = data;
            this.businessStore.createOrReplace(entity.businessId, entity);
        }));
    }

    getPage(opt?) {
        return this.businessDataService.get(opt);
    }

    @transaction()
    add(entity: Business) {
        this.businessStore.add(entity);
        return this.businessDataService.add(entity);
    }

    @transaction()
    update(entity: Business) {
        this.businessStore.update(entity.businessId, entity);
        return this.businessDataService.update(entity);
    }

    @transaction()
    replace(entity: Business) {
        this.businessStore.createOrReplace(entity.businessId, entity);
    }

    @transaction()
    remove(entity: Business) {
        this.businessStore.remove(entity.businessId);
    }

}

运行ng build后dist文件夹中的文件

import { Business } from 'smb-sp-models/business';
import { BusinessStore } from './business.store';
import { BusinessDataService } from './business-data.service';
export declare class BusinessService {
    private businessStore;
    private businessDataService;
    constructor(businessStore: BusinessStore, businessDataService: BusinessDataService);
    setQueryString(query: string): void;
    get(): import("../../../../../../../../../Volumes/TINNAKORNC/wip/web/smartbiz/node_modules/rxjs/internal/Observable").Observable<any>;
    getById(id: string): import("../../../../../../../../../Volumes/TINNAKORNC/wip/web/smartbiz/node_modules/rxjs/internal/Observable").Observable<any>;
    getPage(opt?: any): import("../../../../../../../../../Volumes/TINNAKORNC/wip/web/smartbiz/node_modules/rxjs/internal/Observable").Observable<import("../../../../../../../../../Volumes/TINNAKORNC/wip/web/smartbiz/node_modules/@datorama/akita/src/plugins/paginator/paginator-plugin").PaginationResponse<Business>>;
    add(entity: Business): import("../../../../../../../../../Volumes/TINNAKORNC/wip/web/smartbiz/node_modules/rxjs/internal/Observable").Observable<any>;
    update(entity: Business): import("../../../../../../../../../Volumes/TINNAKORNC/wip/web/smartbiz/node_modules/rxjs/internal/Observable").Observable<any>;
    replace(entity: Business): void;
    remove(entity: Business): void;
}

问题 请帮助我,这个问题的原因是什么?我在Mac上创建了库,并希望将库分发到任何Windows或其他计算机,但它们看不到上述代码(嵌入Mac路径)的路径。谢谢

0 个答案:

没有答案