From 15bc83a45b02efc957e7dbac10bdfdbcba7b1045 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Wed, 24 Apr 2024 14:05:35 +0200 Subject: [PATCH] MOBILE-4487 plugins: Make 'args' values available to plugin JS --- .../siteplugins/components/plugin-content/plugin-content.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/core/features/siteplugins/components/plugin-content/plugin-content.ts b/src/core/features/siteplugins/components/plugin-content/plugin-content.ts index 6653e3b79..49634c4a9 100644 --- a/src/core/features/siteplugins/components/plugin-content/plugin-content.ts +++ b/src/core/features/siteplugins/components/plugin-content/plugin-content.ts @@ -118,7 +118,11 @@ export class CoreSitePluginsPluginContentComponent implements OnInit, DoCheck { this.data = this.data || {}; this.forceCompile = true; - this.jsData = Object.assign(this.data, CoreSitePlugins.createDataForJS(this.initResult, result)); + this.jsData = { + ...this.args, + ...this.data, + ...CoreSitePlugins.createDataForJS(this.initResult, result), + }; // Pass some methods as jsData so they can be called from the template too. this.jsData.fetchContent = (refresh?: boolean) => this.fetchContent(refresh);