Questions tagged routes

Explore the latest questions and answers asked by our top developers.

Handle typos in manual navigation to URLs in Angular

Looking for a solution to the following problem: When the user manually navigates to a url, e.g www.website.com/logi and makes a typo, I’d like to have some logic to navigate him to the correct …/login url. My website has ~10 pages that have different navigation urls and I want to check for typos there as […]

By Vladimir
Published
Categorized as angular, navigation, routes, typescript Tagged , , ,

How do I use data from the table element from which I came?

I currently have a table of tasks, and I would like to be able to click on one of the tasks to bring me to a new page that shows me the history of all times that task has run. I need a way to pass the Name and ID of the task that I […]

Convert single page HTML to Angular 10

I have created single-page HTML for the website. I have added section tags to differentiate sections. Sections are scroll while scrolling and when clicking on any link from the top menu it will scroll on a specific ection. Below is my HTML code. <div id="pagepiling" class="wrapper"> <section id="home" class="navbar-is-white text-dark pp-scrollable d-flex align-items-center section position-absolute […]

Convert single page HTML to Angular 11

I have created single-page HTML for the website. I have added section tags to differentiate sections. Sections are scroll while scrolling and when clicking on any link from the top menu it will scroll on a specific ection. Below is my HTML code. <div id="pagepiling" class="wrapper"> <section id="home" class="navbar-is-white text-dark pp-scrollable d-flex align-items-center section position-absolute […]

Angular Component reloading whenever clicking fragment

I have an static angular component with fragment URL whenever click on the fragment link component every time loading. How to avoid loading angular component each time http://localhost:53130/sample/url#A http://localhost:53130/sample/url#B <li><a [routerLink]=’"."’ [fragment]="’A’">A</a></li> <li><a [routerLink]=’"."’ [fragment]="’B’">B</a></li> Source: Angular Questions

By Arun kumar
Published
Categorized as angular, fragment, routes, url-routing Tagged , , ,

How to extract value of #id_token from URL

My Angular application is accessed using https://foo/bar/#id_token=xyz. How do i get the value of #id_token in the component. I understand if it had been a query parameter or parameter, I could have got its value using ActivatedRoute , but I cannot modify the url. How to get value of something (like id_token) that is followed […]

By sql dummy
Published
Categorized as angular, routes Tagged ,

Angular Routing and Navigating

My app.component.html is very light <div class="landing-page"> <div class="main"> <router-outlet></router-outlet> <div class="footer"> <div class="logo-wrapper"> <a routerLink="/"><img src="assets/images/logo.png" srcset="assets/images/[email protected] 2x,assets/images/[email protected] 3x" /></a> </div> </div> </div> </div> I have a the following routes defined in AppRoutingModule: const routes: Routes = [ { path: ‘book/:id’, component: BookComponent }, { path: ‘**’, component: LandingPageComponent } ]; in my LandingPageComponent […]

By Kukula Mula
Published
Categorized as angular, navigateurl, routes Tagged , ,

Unable to route in the home page

I am unable to figure out on how the router-outlet works in app.component.html. When I load my default page(http://localhost:4200), I want the <app-homepage></app-homepage> to load in the content section, which is loading fine, however when I try to navigate through my menus from the <app-header></app-header>, when the router-outlet gets called, the <app-homepage> component also loads […]

By hussain
Published
Categorized as angular, routes Tagged ,

How do I display a router parameter in an input box in Angular?

I currently have my routes set as follows in my Angular project: const routes: Routes = [ { path: ‘defect’, component: AppComponent }, { path: ‘defect/:start’, component: DefectComponent } ]; Then in the TS of my DefectComponent I have: //route is declared in my parameters as ActivatedRoute ngOnInit(): void { let temp = this.route.snapshot.paramMap.get(‘start’); if(temp) […]

By JCrew0
Published
Categorized as angular, ngmodel, routes, typescript, url Tagged , , , ,

Uncaught Error: Unexpected value ‘Router’ imported by the module ‘AppModule’. Please add a @NgModule annotation

I was following a tutorial on YT to create a routing app, but I got this error. The code for the app.module.ts is: import { BrowserModule } from ‘@angular/platform-browser’; import { NgModule } from ‘@angular/core’; import { FormsModule } from ‘@angular/forms’; import {HttpClientModule} from ‘@angular/common/http’; import { AppComponent } from ‘./app.component’; import { HomeComponent } […]

By Lorenzo Bertolaccini
Published
Categorized as angular, routes Tagged ,
1 2 3 41

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq