Last active
June 9, 2016 10:43
-
-
Save ndtuan412/ba08c75dec3c38dc572e3ab80e0a7bbd to your computer and use it in GitHub Desktop.
This file contains hidden or 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> | |
<div class="contact box"> | |
<h3>Contact</h3> | |
<div class="form-box form-horizontal"> | |
<div class=" form-inline"> | |
<label for="phone">Phone</label> | |
<input type="phone" class="form-control" name="phone" placeholder="Phone" value.two-way="phone"> | |
</div> | |
</div> | |
</div> | |
</template> |
This file contains hidden or 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
import {bindable} from 'aurelia-framework'; | |
export class ContactCustomElement { | |
@bindable phone; | |
}; |
This file contains hidden or 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> | |
<content></content> | |
</template> |
This file contains hidden or 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
import {bindable} from 'aurelia-framework' | |
export class CreateLocationCustomElement { | |
@bindable myContact; | |
save() { | |
alert(this.myContact.phone); | |
} | |
} |
This file contains hidden or 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>Create Location</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
</head> | |
<body aurelia-app="main"> | |
<create-location view-model.ref="createLocationVM" my-contact.two-way="vm"> | |
<!-- other content --> | |
<contact title="Contact" phone="01234" view-model.ref="vm"></contact> | |
<button type="button" click.delegate="createLocationVM.save()">Save</button> | |
<!-- other content --> | |
</create-location> | |
<script src="https://cdn.rawgit.com/jdanyow/aurelia-bundle/v1.0.3/jspm_packages/system.js"></script> | |
<script src="https://cdn.rawgit.com/jdanyow/aurelia-bundle/v1.0.3/config.js"></script> | |
<script> | |
System.import('aurelia-bootstrapper'); | |
</script> | |
</body> | |
</html> |
This file contains hidden or 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 function configure(aurelia) { | |
aurelia.use | |
.defaultBindingLanguage() | |
.defaultResources() | |
.developmentLogging() | |
.globalResources(["create-location", "contact"]); | |
aurelia.start().then(a => { | |
a.enhance(document.body); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment