MOBILE-4487 plugins: Make block instance available to plugin JS
parent
15bc83a45b
commit
ca24c9df9e
|
@ -34,6 +34,7 @@ export class CoreSitePluginsBlockComponent extends CoreBlockBaseComponent implem
|
||||||
@HostBinding('class') component?: string;
|
@HostBinding('class') component?: string;
|
||||||
method?: string;
|
method?: string;
|
||||||
args?: Record<string, unknown>;
|
args?: Record<string, unknown>;
|
||||||
|
jsData?: Record<string, unknown>; // Data to pass to the component.
|
||||||
initResult?: CoreSitePluginsContent | null;
|
initResult?: CoreSitePluginsContent | null;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
|
@ -62,6 +63,9 @@ export class CoreSitePluginsBlockComponent extends CoreBlockBaseComponent implem
|
||||||
instanceid: this.instanceId,
|
instanceid: this.instanceId,
|
||||||
blockid: this.block.instanceid,
|
blockid: this.block.instanceid,
|
||||||
};
|
};
|
||||||
|
this.jsData = {
|
||||||
|
block: this.block,
|
||||||
|
};
|
||||||
this.initResult = handler.initResult;
|
this.initResult = handler.initResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
<core-site-plugins-plugin-content *ngIf="component && method" [component]="component" [method]="method" [args]="args"
|
<core-site-plugins-plugin-content *ngIf="component && method" [component]="component" [method]="method" [args]="args"
|
||||||
[initResult]="initResult" />
|
[initResult]="initResult" [data]="jsData" />
|
||||||
|
|
Loading…
Reference in New Issue