angular-ui / ui-router

The de-facto solution to flexible routing with nested views in AngularJS
http://ui-router.github.io/
MIT License
13.54k stars 3k forks source link

onRetain does not not fire #3572

Closed Mobiletainment closed 6 years ago

Mobiletainment commented 6 years ago

This is a:

My version of UI-Router is: uirouter/angularjs@1.0.11

Bug Report

Current Behavior:

I have the following state declaration:

const state: Ng1StateDeclaration = {
            url: "/{typeName}/{id}",
            params: {id: null, typeName: null},
            onExit: [() => {
                console.log("onExit");
            }],
            onRetain: [() => {
                console.log("onRetain");
            }],
            views: ...
            reloadOnSearch: false
        };

Expected Behavior:

I'd expect the onRetain transition hook to be called, but it doesn't. However, onExit is triggered just fine.

General Query

Please review the Sample Application which highlights common approaches: https://github.com/ui-router/sample-app-ng1

christopherthielen commented 6 years ago

Seems to work? http://plnkr.co/edit/iA2M2WPtsRzUppYMqTbJ

Please provide a plunker or stackblitz which demonstrates the issue