Using core-site-plugins-call-ws-on-load directive

Using core-site-plugins-call-ws-on-load directive

by Naomi Quirke -
Number of replies: 0

In my mobile app plugin, inside a mustache template, I use the line:

<span core-site-plugins-call-ws-on-load name="mod_cado_view_cado" [params]="{cadoid: 32}"></span

The purpose of it is to run background code that will log the use of the activity.

I copied this line from the documentation here: https://docs.moodle.org/dev/Mobile_support_for_plugins#core-site-plugins-call-ws-on-load, which is also replicated in the code here: https://github.com/moodlehq/moodleapp/blob/399eed4c1961aba9bfc90c5988e256e478749105/src/core/siteplugins/directives/call-ws-on-load.ts

It all works fine, in that the activity use is logged. The problem is that I get mustache linting errors.
"WARNING: HTML Validation error" comes up for span attributes: core-site-plugins-call-ws-on-load, name, and params.

After some frenetic googling, the best explanation to me is that 'custom' attributes are deprecated.
Is there another way of using the directive and other similar directives such as core-link that also sit inside html elements?
Am I missing some new way of doing stuff?

Average of ratings: -