Currently i am upgrading an Angularjs 1.6 app into Angular 7. As part of this migration i have to navigate to a state defined in Angularjs from Angular template. How can i achieve this?
I have tried angular-hybrid router approach, but it didn't help.
This is the state defined under recipes module in Angularjs
$stateProvider.state('recipes', {
url: '/recipes',
component: 'recipes',
onEnter: ['$state', 'authService', ($state, authService) => {
if(!authService.isLoggedIn()){
$state.go('login')
}
}]
})
And i want to navigate to above state from Angular 7 template as shown below using angular-hybrid-router
<a class="list-group-item"
style="cursor: pointer;"
ui-sref="recipes"
*ngFor="let recipe of recipes; let i = index;">
{{recipe.name}}
</a>
</ul>
Expected is to navigate to /recipes url. But it doesn't and even doesn't thrown any error.