Webpack
Getting the plugin
$ npm install --save aurelia-materialize-bridge materialize-cssConfigure your app
<body aurelia-app="main"><link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">import {PLATFORM} from 'aurelia-pal'; import 'materialize-css'; export function configure(aurelia) { aurelia.use .standardConfiguration() .developmentLogging() // Install and configure the plugin .plugin(PLATFORM.moduleName('aurelia-materialize-bridge'), b => b.useAll()); aurelia.start(); // delay setting the root until document is fully loaded // this will allow materialize framework fully load before bridge elements start attaching themselves new Promise(resolve => $(document).ready(() => resolve())).then(a => a.setRoot()); }.plugin(PLATFORM.moduleName('aurelia-materialize-bridge'), bridge => { bridge .useButton() .useCollapsible() .useModal() .useTabs(); });<require from="materialize-css/dist/css/materialize.css"></require>new ProvidePlugin({ '$': 'jquery', 'jQuery': 'jquery', 'window.jQuery': 'jquery', })
You are done!
Last updated