O'Reilly logo

Mastering KnockoutJS by Timothy Moran

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Modal dialogs

After the overuse of modal dialogs in Windows, and alert boxes in early browser applications, modal dialogs have left a bad taste with some developers. However, when used appropriately, they are simple and powerful tools. Durandal's modal dialog implementation makes collecting user input from modals very easy, by making dialogs return promises that resolve when they close. Modal dialogs in Durandal come in two types, namely, message boxes and custom dialogs.

Message boxes

For simple cases such as displaying a notification or collecting a single piece of user input, Durandal provides a modal dialog on app.showMessage, which takes the following parameters:

  • Message (string): This contains the main contents of the message box.
  • Title (string, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required