angular-ui / angular-ui/ui-router

$urlRouterProvider.when is ignoring { priority: -1 }

未關閉
#3,830 1 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視
stale
主要語言
TypeScript
星號
13.4k
分支
2.9k
PR 合併指標
30 天內沒有已合併 PR

描述

This issue tracker is for Bug Reports and Feature Requests only.

Please direct requests for help to StackOverflow.
See http://bit.ly/UIR-SOF for details.

This is a (check one box):

- [x] Bug Report
- [ ] Feature Request
- [ ] General Query

My version of UI-Router is: `1.0.29`

# Bug Report

#### Current Behavior:

When configuring a route such as the following:

```javascript
$urlRouterProvider.when('/{path:.+}', '/404?path', { priority: -1 })
```
If after the application is loaded I check `$urlRouter.rules()`, the rule that's associated with this `when` call has a `{ priority: 0 }` rather than the `{ priority: -1 }` that we specified.

However, if we do this in a `.run` it works:

```javascript
$urlRouter.when('/{path:.+}', '/404?path', { priority: -1 })
```
And the `{ priority: -1 }` is correctly configured in the `$urlRouter.rules()` for this rule.

#### Expected Behavior:

That `$urlRouterProvider.when` has the same interface as `$urlRouter.when` in that it honors the `options` passed as the 3rd argument.

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。