Skip to content

Instantly share code, notes, and snippets.

@MaximBalaganskiy
Created May 10, 2018 12:00
Show Gist options
  • Save MaximBalaganskiy/7ba9a22d222507384723c06fe3fed569 to your computer and use it in GitHub Desktop.
Save MaximBalaganskiy/7ba9a22d222507384723c06fe3fed569 to your computer and use it in GitHub Desktop.
<!doctype html>
<html>
<head>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
</head>
<body>
<div aurelia-app="src/configure">
Loading...
</div>
<script src="https://rawgit.com/aurelia-ui-toolkits/demo-materialize/gh-pages/jspm_packages/system.js"></script>
<script src="https://rawgit.com/aurelia-ui-toolkits/demo-materialize/gh-pages/jspm.config.js"></script>
<script>
System.import("aurelia-bootstrapper");
</script>
</body>
</html>
<template>
<div>
<md-input label="put some text here" value.bind="textValue" disabled.bind="disabledValue"></md-input>
<br /> You entered: ${textValue}
<br />
<button md-button="flat: true;" md-waves class="accent-text" click.delegate="setText()">set text to something</button>
<button md-button="flat: true;" md-waves class="accent-text" click.delegate="setDisabled()">Toggle Input Disabling</button>
<md-input label="readonly - bound to the field above" value.bind="textValue" readonly.bind="true"></md-input>
<br />
This is an inline input field:
<md-input label="put some text here" value.bind="textValue" disabled.bind="disabledValue" inline="true"></md-input>
</div>
</template>
export class App {
textValue = "";
disabledValue = false;
setText() {
this.textValue = "something";
}
setDisabled() {
this.disabledValue = !this.disabledValue;
}
}
export async function configure(aurelia) {
await aurelia.loader.loadModule("materialize-css");
aurelia.use
.standardConfiguration()
.developmentLogging()
.plugin("aurelia-materialize-bridge", bridge => bridge.useAll())
.plugin("aurelia-validation")
.globalResources("src/shared/logger");
await aurelia.start();
aurelia.setRoot("src/app");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment