MOBILE-4487 plugins: Make 'args' values available to plugin JS

main
Dani Palou 2024-04-24 14:05:35 +02:00
parent bfd37520bf
commit 15bc83a45b
1 changed files with 5 additions and 1 deletions

View File

@ -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);