Skip to content

Instantly share code, notes, and snippets.

@kevana
Last active May 27, 2016 22:44
Show Gist options
  • Save kevana/8e3ec69171555bdc2dbbc3e8bc662003 to your computer and use it in GitHub Desktop.
Save kevana/8e3ec69171555bdc2dbbc3e8bc662003 to your computer and use it in GitHub Desktop.
API example for new modal manager
const viewModel = {
name: 'John',
credit: false,
}
const [openModal, closeModal] = modalManager.fire({ content: '#foo-tmpl', viewModel })
openModal
.then(() => console.log('modal opened'))
closeModal
.then((val) => console.log('modal closed, resolved with value', val))
const viewModel = {
name: 'John',
credit: false,
}
sitemodal.fire({ content: '#foo-tmpl', viewModel },
() => console.log('modal opened'),
() => console.log('modal closed, no return value')
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment