-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING CHANGE: Built-in
string
parameter type no longer encodes s…
…lashes as `~2F` nor tildes as `~~` Previously, the `string` parameter type pre-encoded tilde chars (`~`) as two tilde chars (`~~`) and slashes (`/`) as `~2F`. Now, the `string` parameter type does not pre-encode slashes nor tildes. If you rely on the previous encoding, create a custom parameter type that implements the behavior: ```js urlMatcherFactory.type('tildes', { encode: (val: any) => val != null ? val.toString().replace(/(~|\/)/g, m => ({ '~': '~~', '/': '~2F' }[m])) : val; decode: (val: string) => val != null ? val.toString().replace(/(~~|~2F)/g, m => ({ '~~': '~', '~2F': '/' }[m])) : val; pattern: /[^/]*/ }); ``` BREAKING CHANGE: Path/Query parameters no longer default to `string` param type Previously, if a url parameter's type was not specified (in either the path or query), it defaulted to the `string` type. Now, path parameters default to the new `path` type and query parameters default to the new `query` type. **In Angular 1 only**, the new `path` parameter type retains the old behavior of pre-encoding `~` to `~~` and `/` to `~2F` feat(params): Add `path` and `query` param types docs(params): Add docs for built-in param types docs(params): Document `raw` parameters Closes angular-ui/ui-router#2452 Closes #14
- Loading branch information
1 parent
bab3ad7
commit 72bb2d8
Showing
7 changed files
with
427 additions
and
180 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.