[2.1.0] WizardComponent.navigation undefined
See original GitHub issueI’m trying to use goToStep in code and have followed previous suggestions but the navigation property seems to be undefined. Let me know what other information I can provide to help.
Aside: Trying to jump to a specific step from a remote page. Is there a good way to use routing with wizard steps? The below example code gives console error: ERROR TypeError: Cannot read property 'goToStep' of undefined
import { Component, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { WizardComponent } from 'ng2-archwizard';
@Component({
selector: 'app-my-custom-wizard',
templateUrl: './my-custom-wizard.component.html',
styleUrls: ['./my-custom-wizard.component.css']
})
export class MyCustomWizardComponent implements OnInit {
@ViewChild(WizardComponent)
public wizard: WizardComponent;
constructor(private route: ActivatedRoute) {
}
ngOnInit() {
this.route
.queryParams
.subscribe((params) => this.wizard.navigation.goToStep(+params.step));
}
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
React native/navigation error displaying component ...
React native/navigation error displaying component/component is undefined · First I got an error saying Text strings must be rendered within a < ...
Read more >undefined is not an object evaluating navigation.navigate
<TouchableHighlight onPress={() => navigation.navigate('DrawerOpen')}>. On mainScreen , you are fine because it's not a pure component with ...
Read more >Access the navigation prop from any component
It's useful when you cannot pass the navigation prop into the component directly ... throw an 'undefined is not a function' exception because...
Read more >React Native: undefined is not a function(evaluating '(0 ...
React Native changes so often and some parts that we take for granted suddenly changes. So if you have an old version of...
Read more >Track the Current Route in React Navigation V5 Outside Of a ...
React Navigation 5.x has useful hooks that are great when you don't want to pass ... Routes | undefined => { if (state.index...
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 FreeTop 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
Top GitHub Comments
I’m trying to use goToNextStep in code
nope doesn’t work with version 7.0.0