Hi Guys,
I am trying to implement the mobile view for a plugin following the documentation here:
https://docs.moodle.org/dev/Moodle_App_Plugins_Development_Guide#CoreBlockDelegate
In the template I am trying to use moodle defined copyToClipboard function:
<ion-card class="md hydrated">
<ion-item>
<ion-label
class="ion-text-wrap core-course-title sc-ion-label-md-h sc-ion-label-md-s md hydrated">
<div id="container">
<p>
<ion-button color="primary" (click)="this.utils.copyToClipboard('bobobob');">Copy</ion-button>
</p>
</div>
</ion-label>
</ion-item>
</ion-card>
and I get the error:
index.ts:41 ERROR TypeError: Cannot read properties of undefined (reading 'copyToClipboard')
Also when trying to user the standard Ionic function:
<ion-card class="md hydrated">
<ion-item>
<ion-label
class="ion-text-wrap core-course-title sc-ion-label-md-h sc-ion-label-md-s md hydrated">
<div id="container">
<p>
<ion-button color="primary" (click)="clipboard.copy('bobobob');">Copy</ion-button>
</p>
</div>
</ion-label>
</ion-item>
</ion-card>
I get something like
Cannot read properties of undefined (reading 'copy')
Is there something I am doing wrong here? Should I import the library or something?
Thanks!