我正在寻找一种创建具有多个模块的angular 6(通过Angular 6 CLI可能)的库的方法,可以根据开发人员的需要将每个模块本身导入。
到现在为止,我仅找到描述使用几个组件创建简单库的教程。所有这些都必须由库NgModule导入。但目标是能够将某些模块导入生产应用程序,而无需从库模块中导入所有其他内容(组件等)。
I wanted to store objects with their methods with @ngrx/entity . Can it cause any problems in application? (Angular 2-7)
mission.class.ts:
import { v4 as uuid} from 'uuid';
export class Mission {
id: string;
title: string;
completed: boolean;
constructor (missionTitle: string, completed?: boolean) {
this.id = uuid();
this.title = missionTitle;
this.completed = completed;
}
complete() {
this.completed = true;
}
}Run Code Online (Sandbox Code Playgroud)
There is the class with method 'complete' mission. I want to save it by @ngrx/entity.
missions.actions.ts:
export enum MissionActionTypes …Run Code Online (Sandbox Code Playgroud)