Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
URL Rewriter Bot
URL Rewriter Bot

I have a couple of parameters that are fundamental and often present in my application.

Simplified exemple of url in the router definition:

url:'/settings/:id'
url:'/profile/:id'
url:'/account/:id'

Do I need to pass this :id parameter on every state.go() or ui-sref?

Example:

ui-sref="settings({id:vm.id})"
ui-sref="profile({id:vm.id})"
ui-sref="account({id:vm.id})"

I would be much simpler if there were a way to copy the named url parameters and specify a specific parameter if I would like to replace it or omit it.

Example:

ui-sref="account"

And if and only if I would like to overwrite it:

ui-sref="account({id:vm.anotherId})"

According to the API inherit is the default behaviour: "inherit Boolean (default true), If true will inherit url parameters from current url." https://github.com/angular-ui/ui-router/wiki/Quick-Reference#stategoto--toparams--options

And this applys to ui-sref also according to: "There is no functional difference between ui-sref and $state.go. See the doc" Difference between ui-sref and $state.go in AngularJS UI-RouterDifference between ui-sref and $state.go in AngularJS UI-Router

This seems trivial, or I misunderstand something :-( I have tried playing around with nested states, but the real application has not the nested states carasteristics.

I have a couple of parameters that are fundamental and often present in my application.

Simplified exemple of url in the router definition:

url:'/settings/:id'
url:'/profile/:id'
url:'/account/:id'

Do I need to pass this :id parameter on every state.go() or ui-sref?

Example:

ui-sref="settings({id:vm.id})"
ui-sref="profile({id:vm.id})"
ui-sref="account({id:vm.id})"

I would be much simpler if there were a way to copy the named url parameters and specify a specific parameter if I would like to replace it or omit it.

Example:

ui-sref="account"

And if and only if I would like to overwrite it:

ui-sref="account({id:vm.anotherId})"

According to the API inherit is the default behaviour: "inherit Boolean (default true), If true will inherit url parameters from current url." https://github.com/angular-ui/ui-router/wiki/Quick-Reference#stategoto--toparams--options

And this applys to ui-sref also according to: "There is no functional difference between ui-sref and $state.go. See the doc" Difference between ui-sref and $state.go in AngularJS UI-Router

This seems trivial, or I misunderstand something :-( I have tried playing around with nested states, but the real application has not the nested states carasteristics.

I have a couple of parameters that are fundamental and often present in my application.

Simplified exemple of url in the router definition:

url:'/settings/:id'
url:'/profile/:id'
url:'/account/:id'

Do I need to pass this :id parameter on every state.go() or ui-sref?

Example:

ui-sref="settings({id:vm.id})"
ui-sref="profile({id:vm.id})"
ui-sref="account({id:vm.id})"

I would be much simpler if there were a way to copy the named url parameters and specify a specific parameter if I would like to replace it or omit it.

Example:

ui-sref="account"

And if and only if I would like to overwrite it:

ui-sref="account({id:vm.anotherId})"

According to the API inherit is the default behaviour: "inherit Boolean (default true), If true will inherit url parameters from current url." https://github.com/angular-ui/ui-router/wiki/Quick-Reference#stategoto--toparams--options

And this applys to ui-sref also according to: "There is no functional difference between ui-sref and $state.go. See the doc" Difference between ui-sref and $state.go in AngularJS UI-Router

This seems trivial, or I misunderstand something :-( I have tried playing around with nested states, but the real application has not the nested states carasteristics.

added 478 characters in body
Source Link

I have a couple of parameters that are fundamental and often present in my application.

ExempleSimplified exemple of url in the router definition:

url:'/settings/:id'
url:'/profile/:id'
url:'/account/:id'

Do I need to pass this :id parameter on every state.go() or ui-sref?

Example:

ui-sref="settings({id:vm.id})"
ui-sref="profile({id:vm.id})"
ui-sref="account({id:vm.id})"

I would be much simpler if there were a way to copy the named url parameters and specify a specific parameter if I would like to replace it or omit it.

Example:

ui-sref="account"

And if and only if I would like to overwrite it:

ui-sref="account({id:vm.anotherId})"

According to the API inherit is the default behaviour: "inherit Boolean (default true), If true will inherit url parameters from current url." https://github.com/angular-ui/ui-router/wiki/Quick-Reference#stategoto--toparams--options

And this applys to ui-sref also according to: "There is no functional difference between ui-sref and $state.go. See the doc" Difference between ui-sref and $state.go in AngularJS UI-Router

This seems trivial, or I misunderstand something :-( I have tried playing around with nested states, but the real application has not the nested states carasteristics.

I have a couple of parameters that are fundamental and often present in my application.

Exemple of url in the router definition:

url:'/settings/:id'
url:'/profile/:id'
url:'/account/:id'

Do I need to pass this :id parameter on every state.go() or ui-sref?

Example:

ui-sref="settings({id:vm.id})"
ui-sref="profile({id:vm.id})"
ui-sref="account({id:vm.id})"

I would be much simpler if there were a way to copy the named url parameters and specify a specific parameter if I would like to replace it or omit it.

Example:

ui-sref="account"

And if and only if I would like to overwrite it:

ui-sref="account({id:vm.anotherId})"

This seems trivial, or I misunderstand something :-( I have tried playing around with nested states, but the real application has not the nested states carasteristics.

I have a couple of parameters that are fundamental and often present in my application.

Simplified exemple of url in the router definition:

url:'/settings/:id'
url:'/profile/:id'
url:'/account/:id'

Do I need to pass this :id parameter on every state.go() or ui-sref?

Example:

ui-sref="settings({id:vm.id})"
ui-sref="profile({id:vm.id})"
ui-sref="account({id:vm.id})"

I would be much simpler if there were a way to copy the named url parameters and specify a specific parameter if I would like to replace it or omit it.

Example:

ui-sref="account"

And if and only if I would like to overwrite it:

ui-sref="account({id:vm.anotherId})"

According to the API inherit is the default behaviour: "inherit Boolean (default true), If true will inherit url parameters from current url." https://github.com/angular-ui/ui-router/wiki/Quick-Reference#stategoto--toparams--options

And this applys to ui-sref also according to: "There is no functional difference between ui-sref and $state.go. See the doc" Difference between ui-sref and $state.go in AngularJS UI-Router

This seems trivial, or I misunderstand something :-( I have tried playing around with nested states, but the real application has not the nested states carasteristics.

Source Link

ui-router / ui-sref, inherited parameters?

I have a couple of parameters that are fundamental and often present in my application.

Exemple of url in the router definition:

url:'/settings/:id'
url:'/profile/:id'
url:'/account/:id'

Do I need to pass this :id parameter on every state.go() or ui-sref?

Example:

ui-sref="settings({id:vm.id})"
ui-sref="profile({id:vm.id})"
ui-sref="account({id:vm.id})"

I would be much simpler if there were a way to copy the named url parameters and specify a specific parameter if I would like to replace it or omit it.

Example:

ui-sref="account"

And if and only if I would like to overwrite it:

ui-sref="account({id:vm.anotherId})"

This seems trivial, or I misunderstand something :-( I have tried playing around with nested states, but the real application has not the nested states carasteristics.