Browse Source

Update npm/ng-packs/packages/core/src/lib/services/replaceable-components.service.ts

Co-authored-by: Levent Arman Özak <arman@armanozak.com>
pull/5333/head
Mehmet Erim 6 years ago
committed by GitHub
parent
commit
0c5fbee1c3
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      npm/ng-packs/packages/core/src/lib/services/replaceable-components.service.ts

4
npm/ng-packs/packages/core/src/lib/services/replaceable-components.service.ts

@ -43,7 +43,7 @@ export class ReplaceableComponentsService {
}
add(replaceableComponent: ReplaceableComponents.ReplaceableComponent, reload?: boolean): void {
let replaceableComponents = this.store.state;
const replaceableComponents = [...this.store.state];
const index = replaceableComponents.findIndex(
component => component.key === replaceableComponent.key,
@ -52,7 +52,7 @@ export class ReplaceableComponentsService {
if (index > -1) {
replaceableComponents[index] = replaceableComponent;
} else {
replaceableComponents = [...replaceableComponents, replaceableComponent];
replaceableComponents.push(replaceableComponent);
}
this.store.patch(replaceableComponents);

Loading…
Cancel
Save