Skip to content

uiSref does not update 'href' if an required param is ever undefined #2091

Closed
@christopherthielen

Description

@christopherthielen

If ui-sref ever fails to generate an href, it gives up on ever trying again. This is a problem for a ui-sref which targets a state that has any required params, if the bound values are ever null.

Due to this code: https://github.com/angular-ui/ui-router/blob/master/src/stateDirectives.js#L107-L118

I think we should probably just get rid of the "!nav" check alltogether.

To see this fail, change this line https://github.com/angular-ui/ui-router/blob/master/test/stateDirectivesSpec.js#L15 from an optional string parameter to a required int parameter.

that is, change url: "/:id" to url: "/{id:int}"

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions