X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fshared%2Fshared-custom-markup%2Fdynamic-element.service.ts;h=a129070553b35dc7e2bd7da023721eff0c6107d3;hb=54909304287f3c04dcfb39660be8ead57dc95440;hp=208dba721dd8d8fcfc21ee9a0632bf8a4ef07385;hpb=d0fbc9fd0a29c37f3ff9b99030351e90b276fe7d;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/shared/shared-custom-markup/dynamic-element.service.ts b/client/src/app/shared/shared-custom-markup/dynamic-element.service.ts index 208dba721..a12907055 100644 --- a/client/src/app/shared/shared-custom-markup/dynamic-element.service.ts +++ b/client/src/app/shared/shared-custom-markup/dynamic-element.service.ts @@ -10,6 +10,7 @@ import { SimpleChanges, Type } from '@angular/core' +import { objectKeysTyped } from '@shared/core-utils' @Injectable() export class DynamicElementService { @@ -41,12 +42,12 @@ export class DynamicElementService { setModel (componentRef: ComponentRef, attributes: Partial) { const changes: SimpleChanges = {} - for (const key of Object.keys(attributes)) { + for (const key of objectKeysTyped(attributes)) { const previousValue = componentRef.instance[key] const newValue = attributes[key] componentRef.instance[key] = newValue - changes[key] = new SimpleChange(previousValue, newValue, previousValue === undefined) + changes[key as string] = new SimpleChange(previousValue, newValue, previousValue === undefined) } const component = componentRef.instance