3.4 Button component

View: md-button.html

<template>
  <h4>Materialize button demo</h4>
  <div class="row">
    <div class="col s4">
      <button md-button="disabled.bind: disabled;" click.trigger="showToast()">Materialize Button</button>
    </div>
  </div>
</template>

Just like in the case of the Select control, the statement <button md-button="disabled.bind: disabled;" click.trigger="showToast()">Materialize Button</button>

results with the instantiation of the button:

Image 1

Observe that the button control, just like the select control are HTML native elements and that Materialize Aurelia bridge adds custom attributes (md-button) that are bound to Materialize button) "matching native properties" . Note also the definition of the event triggers that are activating the code in the view model:

View model: md-button.js

Finally, add the new component to your router-configuration:

File app.js

Last updated