Unlike the previous two controls, Slider is represented (by Aurelia Materialize bridge) as an Aurelia custom element (component) - since slider is not a native HTML element.
Here is this view rendered by the application associated with this tutorial.
Image 1
The HTML code in the view is a good demonstration of Aurelia's support for declarative programming - all attributes of the slider are declared there and bound to view model shown next.
View model: md-slider.js
export class MdSliderDemo {
slides = [
{ img: 'http://lorempixel.com/580/250/nature/1', align: 'center', heading: 'This is our big Tagline!', subheading: 'Here is our small slogan.' },
{ img: 'http://lorempixel.com/580/250/nature/2', align: 'left', heading: 'Left Aligned Caption', subheading: 'Here is our small slogan.' },
{ img: 'http://lorempixel.com/580/250/nature/3', align: 'right', heading: 'Right Aligned Caption', subheading: 'Here is our small slogan.' },
{ img: 'http://lorempixel.com/580/250/nature/4', align: 'center', heading: 'This is another big Tagline!', subheading: 'Here is our small slogan.' }
];
}
Finally, add the new component to your router-configuration: