NavController lifecycle events interfaces
See original GitHub issueShort description of the problem:
NavController’s lifecycle events should have interfaces.
What behavior are you expecting?
Provide interfaces, which compel us to implement the corresponding methods like OnInit
in Angular2, in order to benefit from typing and editor tooling.
Which Ionic Version? 1.x or 2.x 2.x
Issue Analytics
- State:
- Created 7 years ago
- Reactions:8
- Comments:8 (3 by maintainers)
Top Results From Across the Web
NavController | Android Developers
Gets the ViewModelStoreOwner for a NavGraph. This can be passed to androidx.lifecycle.ViewModelProvider to retrieve a ViewModel that is scoped to the navigation ...
Read more >NavController lifecycle events interfaces · Issue #7512 - GitHub
Short description of the problem: NavController's lifecycle events should have interfaces. What behavior are you expecting?
Read more >UINavigationController | Apple Developer Documentation
A container view controller that defines a stack-based scheme for navigating hierarchical content.
Read more >NavController.java - android Git repositories
NavController manages app navigation within a {@link NavHost}. ... handleLifecycleEvent(event); ... public interface OnDestinationChangedListener {.
Read more >Navigating Lifecycle Events! - Ionic Blog
In Ionic 2, any view added or removed from a NavController emits certain events. You can take advantage of those events to instantiate...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
These interfaces assure that a component implements the hooks correctly; it eliminates the possibility of typos. Even if the methods should be renamed in the future, we could detect that change.
Besides, we could benefit from an IDE. Without these interfaces, we have to refer to the doc page to remember the name of the methods every time. But some IDEs are intelligent enough to suggest apposite candidates in an
import
sentence.For example, we only have to type
On
in the curly brackets below to see the list of the lifecycle interfaces provided by Angular2:OnInit
,OnChanges
, andOnDestroy
.import { } from '@angular/core';
We only have to choose one of them and declare it in order to know which methods should be implemented if interfaces are provided.
I think it would be nice that ionic could provide such features. Thanks. 😃
@jvbianchi @fknop @ValterSantosMatos @ysgk please feedback!! https://github.com/driftyco/ionic/pull/10649