Created
March 14, 2018 01:53
-
-
Save AbraaoAlves/9e5957184f1ad22aacd337aac1f01e8f to your computer and use it in GitHub Desktop.
Dialog stuff
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> | |
<h1>Dialog Repro</h1> | |
<button click.delegate="dt.openDialogA()">Open Dialog</button> | |
</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 { DialogTrigger } from './dialog-trigger'; | |
export class App { | |
static inject = [DialogTrigger]; | |
constructor(dialogTrigger) { | |
this.dt = dialogTrigger; | |
} | |
} |
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 { DialogService } from 'aurelia-dialog'; | |
export class DialogTrigger { | |
static inject = [DialogService]; | |
constructor(dialogService) { | |
this._dialogService = dialogService; | |
} | |
openDialogA() { this._dialogService.open({ viewModel: './prompt' }); } | |
openDialogB() { this._dialogService.open({ viewModel: './prompt' }); } | |
} |
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-validation') | |
.plugin('aurelia-dialog'); | |
aurelia.start().then(a => a.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> | |
<h5 click.delegate="dt.openDialogB()">Open dialog B</h5> | |
</ai-dialog-body> | |
<ai-dialog-footer> | |
<input placeholder="click me" attach-focus="true" value.bind="firstName" /> | |
<button click.trigger="dialogController.cancel()">Cancel</button> | |
<button click.trigger="dialogController.ok()">Ok</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 { DialogTrigger } from './dialog-trigger'; | |
import {Validator} from 'aurelia-validation'; | |
export class Prompt { | |
static inject = [DialogController, DialogTrigger, Validator]; | |
firstName = 'abraao'; | |
validator = null; | |
constructor(dialogController, dialogTrigger, validator) { | |
this.dialogController = dialogController; | |
this.dt = dialogTrigger; | |
this.validator = validator; | |
} | |
activate(person){ | |
this.person = person; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment