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

Using activators

The activation life cycle is automatically used by the router, but sometimes, you want to use it without tying the work to the URL, which turns out to be quite easy. An activator is just a computed observable whose write function enforces the life cycle. An activator can be created by calling activator.create() using the durandal/activator module.

For this example, we are going to add an inline quick edit to the list page that will allow contacts to be edited without navigating to another page. It will leverage the existing edit page viewmodel with some minor changes, as it already has a canDeactivate method that prompts the user with a confirmation modal when unsaved changes are present. The list page activator will hook into ...

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