Questions tagged [route-parameters]

Frameworks that provide routers like offer logic to define routes in a parametrized way

28 questions
50
votes
5 answers

How to get :id param of child route from parent component in Angular2

I'm trying to get the :id param defined in RouterModule.forRoot([ { path: 'orders', component: ListComponent, children: [ { path: 'view/:id', component: ViewComponent }, ] } ]) from ListComponent. I…
5
votes
2 answers

laravel route parameters return null on unittest

I got a problem on phpunit I'm design route as /v1/outlet/{outlet_id}/test Route::get('outlets/{outlet_id}/test', ['as' => 'test'], function(){ return app('request')->route('outlet_id'); }); It's working when i call it in postman or brower…
Nonny PSK
  • 51
  • 4
3
votes
1 answer

Angular - Get Route Parameters from parent route

I have a global routing module which allows me to correctly navigate to my component module which is lazy loaded. Inside the component module I have a child route which can be correctly loaded. What I can't seem to do however is access the userID…
Que
  • 957
  • 2
  • 14
  • 35
2
votes
2 answers

How to access stylesheet when I render as EJS in a dynamic route based on URL parameters

I recently started learning Express.js and mongoose by creating a simple To-Do List, and now I'm stuck with a basic thing. When I tried to render a EJS file in a dynamic route based on URL parameters, I was unable to apply the stylesheet.css which…
2
votes
1 answer

Accessing route parameters - angular 8

Hey trying to build website with products, but i can't get data from productsComponent to ProductDetailsComponent. Please help me. In my Product.ts i have : export class Product { id: number; name: string; constructor(id: number, name:…
Valery Mihaylov
  • 33
  • 1
  • 1
  • 4
2
votes
1 answer

How to read URI Parameters using HttpContextAccessor in ASP.NET Core

I am trying to read the URL parameters sent to an WEB API Action Method using the IHttpContextAccessor interface and its default implementation HttpContextAccessor from within a DelegatingHandler. The controller looks like…
D.B
  • 4,009
  • 14
  • 46
  • 83
2
votes
1 answer

Matrix URI and ASP.NET Core

Wondering if anyone has attempted to use Matrix URI's with ASP.NET Core? We're building an Angular front-end that uses their version called Route Parameters. The front-end will need to make a similar call to our back-end and it's build on ASP.NET…
Patrick
  • 3,624
  • 7
  • 31
  • 28
1
vote
0 answers

Add route parameter to Blazor server app's index page

I'm developing a Blazor Server app using .NET 6.0. I would like for the index page to utilize a route parameter: @page "/{vendorId}" @functions { [Parameter] public string? vendorId { get; set; } } So, a user navigating to…
1
vote
2 answers

laravel route::post wrong method gets called

Starting off with a bit of background information, i have 3 models - Course, Pathway, Module. Course HAS-MANY Pathway Pathway HAS-MANY Module Course HAS-MANY-THROUGH Module (through Pathway) I have set up routes for creating Course, Pathway and…
Suhaib Ahmad
  • 487
  • 6
  • 25
1
vote
2 answers

How to use route variable immediately after define in angular 11?

I want to use route variable for breadcrumb title. For example: { path:'sample/:title', data:{ breadcrumb:[ {title:'sample',link:'sample'}, {title:using :title variable here} ] } } Is there a way to use variable immediately after…
1
vote
1 answer

Refused to apply style because its MIME type ('text/html') is not a supported stylesheet MIME type

I am making a todo-list .But I am facing a problem. The stylesheet is not being applied on localhost:3000/lists/customList . And it is giving the error : Refused to apply style from 'http://localhost:3000/lists/css/styles.css' because its MIME type…
1
vote
2 answers

Angular 2+ Replace the parameter in the URL when changing manually by the user in the adress bar

I have URL which takes three parameters like localhost:4200/website/param1/param2/pagename/param3?user=userid If the user changes either of the parameters and its not valid , eg:…
DpGp
  • 121
  • 1
  • 13
1
vote
1 answer

How to pass a variable as a route parameter when accessing the route in Laravel?

This does not work: return redirect('/view-project-team/' . $projectRequest->id ); What is the right way to pass a variable into the route in this context?
Code Worm
  • 313
  • 1
  • 4
  • 16
0
votes
0 answers

How can System.ComponentModel.TypeConverter use services from the .net IOC Container?

Per the question above, I'm using the .net 6, with autofac actually, but TypeConverters seem to expect no argument constructors and can't leverage DI directly. ITypeDescriptorContext does inherit from IServiceProvider, but can that be configured to…
0
votes
1 answer

How to get the selected value from a group select in Blade?

Is there a way one can access the value of a group select in order to use it as a parameter in a route? This is the html element:
Mercurie
  • 3
  • 3
1
2