小编Itz*_*tch的帖子

如何使用多个模块创建angular 6库

我正在寻找一种创建具有多个模块的angular 6(通过Angular 6 CLI可能)的库的方法,可以根据开发人员的需要将每个模块本身导入。

到现在为止,我仅找到描述使用几个组件创建简单库的教程。所有这些都必须由库NgModule导入。但目标是能够将某些模块导入生产应用程序,而无需从库模块中导入所有其他内容(组件等)。

angular6

6
推荐指数
1
解决办法
2762
查看次数

Could I store object with its methods in @ngrx

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)

ngrx angular ngrx-entity

6
推荐指数
1
解决办法
624
查看次数

标签 统计

angular ×1

angular6 ×1

ngrx ×1

ngrx-entity ×1