-
-
Save plwalters/b91df5edf408c688d7312c10366ecb81 to your computer and use it in GitHub Desktop.
dialog not re-binding
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> | |
<button click.delegate="prompt()">open dialog</button> | |
<br><br> | |
(app [inline]) inner data:<br> | |
<div repeat.for="s of outer.inner">${s.name}</div> | |
</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'; | |
import {Prompt} from './prompt'; | |
import {DialogService} from 'aurelia-dialog'; | |
export class App { | |
@bindable outer; | |
static inject = [DialogService]; | |
constructor(dialogService) { | |
this.dialogService = dialogService; | |
this.outer = { | |
inner: [{name:'first inner'},{name:'second inner' } ] | |
}; | |
let self = this; | |
setTimeout(function() { | |
self.outer.inner = JSON.parse('[{"name":"replaced 1"},{"name":"replaced 2"}]'); | |
},5000) | |
} | |
prompt() { | |
return this.dialogService.open({viewModel: Prompt, model: this.outer}); | |
} | |
} |
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="main"> | |
<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> |
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 function configure(aurelia) { | |
aurelia.use | |
.standardConfiguration() | |
.developmentLogging() | |
.plugin('aurelia-dialog'); | |
aurelia.start().then(() => aurelia.setRoot()); | |
} |
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> | |
<ai-dialog> | |
<ai-dialog-body> | |
<div repeat.for="i of outer.inner">${i.name}</div> | |
</ai-dialog-body> | |
<ai-dialog-footer> | |
<button click.trigger="controller.cancel()">Cancel</button> | |
</ai-dialog-footer> | |
</ai-dialog> | |
</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 {DialogController} from 'aurelia-dialog'; | |
import {bindable} from 'aurelia-framework'; | |
export class Prompt { | |
static inject = [DialogController]; | |
@bindable outer; | |
constructor(controller){ | |
this.controller = controller; | |
} | |
activate(outer) { | |
this.outer = outer; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment