mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-01-12 22:45:52 +08:00
docs($filter): clarify what is a valid filter name
Also updates the CHANGELOG to add info about this breaking some previous invalid uses of $filter Closes #10054 Closes #10131
This commit is contained in:
committed by
Peter Bacon Darwin
parent
95e03bce7e
commit
d3fb8dd776
@@ -94,7 +94,12 @@
|
||||
([8eabc546](https://github.com/angular/angular.js/commit/8eabc5463c795d87f37e5a9eacbbb14435024061),
|
||||
[#9942](https://github.com/angular/angular.js/issues/9942))
|
||||
|
||||
## Breaking Changes
|
||||
|
||||
- **$parse:** due to [fbad2805](https://github.com/angular/angular.js/commit/fbad2805703569058a4a860747b0e2d8aee36bdf),
|
||||
you can't use characters that have special meaning in AngularJS expressions (ex.: `.` or `-`)
|
||||
as part of filter's name. Before this commit custom filters could contain special characters
|
||||
(like a dot) in their name but this wasn't intentional.
|
||||
|
||||
<a name="1.3.2"></a>
|
||||
# 1.3.2 cardiovasculatory-magnification (2014-11-07)
|
||||
|
||||
@@ -91,6 +91,11 @@ The filter function should be a [pure function](http://en.wikipedia.org/wiki/Pur
|
||||
means that it should be stateless and idempotent. Angular relies on these properties and executes
|
||||
the filter only when the inputs to the function change.
|
||||
|
||||
<div class="alert alert-warning">
|
||||
**Note:** filter names must be valid angular expression identifiers, such as `uppercase` or `orderBy`.
|
||||
Names with special characters, such as hyphens and dots, are not allowed.
|
||||
</div>
|
||||
|
||||
The following sample filter reverses a text string. In addition, it conditionally makes the
|
||||
text upper-case.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user