Somebody can tell me if is possible to open a child route in a new view instead of opening right under it? If so how and how to comeback to the father route previous state of navigation?
Angular route and child route management
75 Views Asked by Pedro At
2
There are 2 best solutions below
0
Damian Plewa
On
It's good to use children, because if you want to use some guards it's gonna work for all children routes, it's very useful when you're creating authenticated routes.
Example:
const routes: Routes = [
{
path: 'first',
children: [
{ path: '', component: FirstComponent },
{ path: 'second', component: SecondComponent },
{
path: 'third',
canActivate: [YourGuard],
children: [
{ path: '', component: ThirdComponent },
{ path: 'another-route', component: FourthComponent },
]
}
],
}
];
Related Questions in ANGULAR
- Is it possible to use ES5 JavaScript with Angular 2 instead of TypeScript?
- Module '"angular2/angular2"' has no exported member 'For'
- import syntax in typescript creating another js file in visual studio
- Separate ts file for imports
- How to use an AngularJS 2 component multiple times in the same page?
- injectables not working in angular 2.0 latest build 26
- Does angular2 bootstrap have a way to dynamically target elements like it does in angular 1.x
- Import {} from location is not found in VS Code using TypeScript and Angular 2
- Angular 2/Typescript: require not found
- ng-switch in Angular2
- Angular 2 import issue: "Zone already exported on window the object!"
- How to make FileReader work with Angular2?
- Writing the most basic Unit test in Angular 2?
- Angular2: Creating child components programmatically
- AngularJS - TypeError: Cannot read property 'canonicalUrl' of undefined
Related Questions in ANGULAR-ROUTER
- How to implement RouteReuseStrategy shouldDetach for specific routes in Angular 2
- Routing With ID in Angular 4
- Cannot read property 'outlets' of null in Angular 4
- Angular 4 Router links not working after redirect
- How to get children of route
- routerLink doesn't work when generated via pipes
- lazy-loaded child route loads twice in Angular
- How do you mock ActivatedRoute
- Angular 4 Cannot match any routes, escaping with %2F
- Angular4 Set Var if Route == 'settings'
- Importing a lazy-loaded module with routes in a module with a route breaks routing
- ANALYZE_FOR_ENTRY_COMPONENTS not working in production to load modules dynamicly
- Router infinite loop with second canActivate guard on lazy-loaded modules
- Angular how to get the non activated children routes
- Angular 4 application rendering issue on Mobile Firefox
Related Questions in ANGULAR-ROUTERLINK
- Difference between [routerLink] and routerLink
- Angular 8 router reloads the full page instead of partial loading. Why?
- parent nav bar link is not active when select children page with conditional user access using routerlink - Angular 15
- routerLink to absolute root of the website ("/") while preserving all the named outlets of current URL
- Angular router link and click event trigger
- Can I use Angular routing with a parameterized component constructor, and if so, how?
- How to define routes for loading previous component from the url which is having data?
- how can i use routerLink for api request in angular?
- Router link to scroll on top if its already on that route
- Angular 7 routerLink directive warning 'Navigation triggered outside Angular zone'
- on router link active change icon
- Router navigate to child route - Angular 6
- Component doesn't get contentChildren when using routerLink angular 6-7
- angular routing - navigate to same component with additional params without destroying the component
- In nebular how to apply routerLink to the user dropdown
Related Questions in ANGULAR-NEW-ROUTER
- AngularJS lazy loading components with ngNewRoute
- Angular 1.4 + ngNewRouter + ES6 : Cannot read property '$routeConfig' of undefined
- NgNewRouter viewport and navigation
- angularjs new router not working on first time of page load
- how to get the alias from the angular-new-router?
- Angular New Router is now ngComponentRouter. What's the equivilant for $componentLoaderProvider
- Angular new router force components folder under root
- How will component() and the New Angular Router work together in 1.5?
- Angular-new-router not found with browserify
- Property '$routeConfig' does not exist on type '($router: any) => void'
- How to inject component router in Angular 1.5?
- Angular new router - Nested components and routing
- Can't separate angular components in angular 1
- Angular route and child route management
- new angular router - autoscroll equivalent
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Instead of
Do: