-
-
Save jdanyow/e177cc5e4a40626bc8ab4d49b6e2ff85 to your computer and use it in GitHub Desktop.
Parent Inheritance Issue
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> | |
<require from="./group"></require> | |
<group group.two-way="groups"></group> | |
</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
import { bindable } from 'aurelia-framework'; | |
export class App { | |
@bindable groups = { | |
type: 'group', | |
id: 'g1', | |
condition: 'AND', | |
// rules: [{ | |
// id: '1' | |
// }, { | |
// id: '6' | |
// }], | |
groups: [{ | |
type: 'group', | |
condition: 'OR', | |
id: 'g2', | |
// rules: [{ | |
// id: '8' | |
// }, { | |
// id: '5' | |
// }], | |
groups: [{ | |
type: 'group', | |
condition: 'OR', | |
id: 'g3', | |
// rules: [{ | |
// id: '8' | |
// }, { | |
// id: '5' | |
// }], | |
groups: [ | |
] | |
}] | |
}] | |
}; | |
} |
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> | |
<dl> | |
<dd> | |
<h4 style="background-color: lightgray"> | |
<p>My id is "${group.id}".</p> | |
<p>I have ${group.groups.length} child group(s).</p> | |
<span if.bind="parent">My parent's name is "${parent.name}".</span> | |
<span if.bind="!parent">I don't have a parent.</span> | |
</h4> | |
<content></content> | |
<group parent.bind="$this" group.two-way="group" repeat.for="group of group.groups"></group> | |
</dd> | |
</dl> | |
</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
import {bindable} from 'aurelia-framework'; | |
export class Group { | |
@bindable group; | |
@bindable parent; | |
} |
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"> | |
<style> | |
thing { | |
display: block; | |
border: 1px solid blue; | |
padding: 5px 5px; | |
} | |
</style> | |
</head> | |
<body aurelia-app> | |
<h1>Loading...</h1> | |
<script src="https://jdanyow.github.io/rjs-bundle/node_modules/requirejs/require.js"></script> | |
<script src="https://jdanyow.github.io/rjs-bundle/config.js"></script> | |
<script src="https://jdanyow.github.io/rjs-bundle/bundles/aurelia.js"></script> | |
<script src="https://jdanyow.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