Import variables into aurelia-dialog view-model or view -
is there way import additional variables/data dialog-service controller?
for example have array of possible options in form of app-view. fetch data via api server.
i'd edit entry aurelia-dialog , don't want fetch data again avoid unnecessary traffic in app.
how can pass array additionally model. pack in object , unwrap in controller? far know activate-method of controller takes 1 argument, doesn't it?
thank you
isn't example in repository looking for? person
attribute passed dialog service via settings
object (model: this.person
). may data fetched server. mentioned, can of course add multiple objects model available in activate()
method of dialogs vm.
import {editperson} './edit-person'; import {dialogservice} 'aurelia-dialog'; export class welcome { static inject = [dialogservice]; constructor(dialogservice) { this.dialogservice = dialogservice; } person = { firstname: 'wade', middlename: 'owen', lastname: 'watts' }; submit(){ this.dialogservice.open({ viewmodel: editperson, model: this.person}).then(response => { if (!response.wascancelled) { console.log('good - ', response.output); } else { console.log('bad'); } console.log(response.output); }); } }
Comments
Post a Comment