-
-
Save jdanyow/e931202307361d472c3e0ee4f523a833 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<ul> | |
<li repeat.for="person of people"> | |
${person.firstName} ${person.lastName} | |
<button click.delegate="editPerson = person">Edit</button> | |
</li> | |
</ul> | |
<form if.bind="editPerson" submit.delegate="save()"> | |
<label> | |
First Name: | |
<input ref="firstNameInput" value.one-way="editPerson.firstName"> | |
</label> | |
<label> | |
Last Name: | |
<input ref="lastNameInput" value.one-way="editPerson.lastName"> | |
</label> | |
<button type="submit">Save</button> | |
<button type="button" click.delegate="editPerson = null">Cancel</button> | |
</form> | |
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class App { | |
people = [ | |
{ firstName: 'John', lastName: 'Doe' }, | |
{ firstName: 'Jane', lastName: 'Smith' }, | |
{ firstName: 'Bob', lastName: 'Smith' } | |
]; | |
editPerson = null; | |
save() { | |
this.editPerson.firstName = this.firstNameInput.value; | |
this.editPerson.lastName = this.lastNameInput.value; | |
this.editPerson = null; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<title>Aurelia</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
</head> | |
<body aurelia-app> | |
<h1>Loading...</h1> | |
<script src="https://ashleygrant.github.io/rjs-bundle/node_modules/requirejs/require.js"></script> | |
<script src="https://ashleygrant.github.io/rjs-bundle/config.js"></script> | |
<script> | |
require.config({ | |
paths: { | |
"sortable": "https://cdnjs.cloudflare.com/ajax/libs/Sortable/1.4.2/Sortable.min" | |
} | |
}); | |
</script> | |
<script src="https://ashleygrant.github.io/rjs-bundle/bundles/aurelia.js"></script> | |
<script src="https://ashleygrant.github.io/rjs-bundle/bundles/babel.js"></script> | |
<script> | |
require(['aurelia-bootstrapper']); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment