Skip to content

Commit 460e43a

Browse files
committed
add note about named watch functions to FAQ
1 parent 5a90f4f commit 460e43a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

FAQ.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,14 @@
22

33
### How do I measure a directive's performance?
44
If your directive uses `$watch`, you should be able to see the watch expression wherever your directive is used.
5+
6+
### My $watch functions show up as just "function ()" in the performance tab
7+
Use named functions for $watch:
8+
9+
```javascript
10+
scope.$watch(function checkIfSomethingChanged() {
11+
// ...
12+
}, function whenThatChanges(newValue, oldValue) {
13+
// ...
14+
});
15+
```

0 commit comments

Comments
 (0)