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

Commit 8b775a0

Browse files
docs(guide/expressions): clarify regexp literals usage in expressions
Closes #10026 Closes #10030
1 parent 0bbc6ee commit 8b775a0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

docs/content/guide/expression.ngdoc

+6
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,12 @@ expression. The reason behind this is core to the Angular philosophy that applic
164164
be in controllers, not the views. If you need a real conditional, loop, or to throw from a view
165165
expression, delegate to a JavaScript method instead.
166166

167+
## No RegExp creation with literal notation
168+
169+
You can't create regular expressions from within AngularJS expressions. This is to avoid complex
170+
model transformation logic inside templates. Such logic is better placed in a controller or in a dedicated
171+
filter where it can be tested properly.
172+
167173
## `$event`
168174

169175
Directives like {@link ng.directive:ngClick `ngClick`} and {@link ng.directive:ngFocus `ngFocus`}

0 commit comments

Comments
 (0)