Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit ecc09a4

Browse files
YonatanKragkalpak
authored andcommitted
docs(guide/expression): add clarification for RegExp literal in ngPattern expression
The `ngPattern` expression does accept a RegExp created with literal notation, hence it should be mentioned as an exception to the "No RegExp Creation With Literal Notation" rule. Closes #16206
1 parent 3651e42 commit ecc09a4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

docs/content/guide/expression.ngdoc

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ AngularJS expressions are like JavaScript expressions with the following differe
3737
even inside `ng-init` directive.
3838

3939
* **No RegExp Creation With Literal Notation:** You cannot create regular expressions
40-
in an AngularJS expression.
40+
in an AngularJS expression. An exception to this rule is {@link ngPattern `ng-pattern`} which accepts valid
41+
RegExp.
4142

4243
* **No Object Creation With New Operator:** You cannot use `new` operator in an AngularJS expression.
4344

0 commit comments

Comments
 (0)