mirror of
https://github.com/moodle/moodle.git
synced 2025-07-27 09:20:36 +02:00
- This tool is only available for admins - Before using this tool the hosting admin will need to have NPM installed and be able to run grunt - To create the docs pages for the library run "grunt componentlibrary" - After the pages are created the Library is available in Site adminstration > Development > UI Component Library
1.2 KiB
1.2 KiB
layout, title, date, group, draft, menu
layout | title | date | group | draft | menu |
---|---|---|---|---|---|
docs | Moodle JavaScript | 2020-01-14T13:38:37+01:00 | moodle-components | false | main |
Running AMD modules
When using this (shortcode) syntax you can showcase your HTML and add some RequireJS style Javascript that will call core AMD modules.
In order for this to work you need to use the JavaScript syntax used in core Mustache templates. See the {{js}}
tags in this example below:
{{< example >}}
{{#js}} require( [ 'jquery', 'theme_boost/toast', ], function( $, Toast ) { var root = $('#toasttest'); root.toast('show'); }); {{/js}} {{< /example >}}