Skip to content

Instantly share code, notes, and snippets.

@Vheissu

Vheissu/app.html Secret

Created March 30, 2016 06:29
Show Gist options
  • Save Vheissu/9b49c26623f4dc6e63a0347ca48af6b3 to your computer and use it in GitHub Desktop.
Save Vheissu/9b49c26623f4dc6e63a0347ca48af6b3 to your computer and use it in GitHub Desktop.
Example of the call attribute functionality being used.
<template>
<require from="./my-view"></require>
<my-view create.call="create_now()"></my-view>
</template>
export class App {
create_now() {
window.alert('Create_now function has been called');
}
}
<!doctype html>
<html>
<head>
<title>Aurelia</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
label, input {
display: block;
}
</style>
</head>
<body aurelia-app>
<h1>Loading...</h1>
<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>
<template>
<button type="button" click.delegate="create()">Create</button>
</template>
import {bindable} from 'aurelia-framework';
export class MyView {
@bindable create;
}
@swalters
Copy link

Please add example of passing variables in .call

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment