Skip to main content
100%

activate-deactivate for header

✓ Published0🌍 Public
RRestuta
Last edited Aug 17, 2015
Created on Aug 17, 2015

This example demonstrates how to manage a dynamic application header in a single-page application by toggling between header states during route activation and deactivation. The code defines `activate()` and `deactivate()` hooks that update a shared `application` model through its `get` and `set` methods, storing the current header before a route change and restoring it upon exit. It uses an application-level model to hold `currentHeader` and a route-local `prevHeader` to track the prior state. The logic relies on the framework’s model API to read and mutate the header value, with `_super(...arguments)` ensuring the parent class methods are invoked.

AI-generated description

Similar vizzes