Permalink
Browse files

add note about named watch functions to FAQ

  • Loading branch information...
1 parent 5a90f4f commit 460e43aad1dd89880d2c90ff64fbc4e6651498ef @btford btford committed Jan 1, 2013
Showing with 11 additions and 0 deletions.
  1. +11 −0 FAQ.md
View
11 FAQ.md
@@ -2,3 +2,14 @@
### How do I measure a directive's performance?
If your directive uses `$watch`, you should be able to see the watch expression wherever your directive is used.
+
+### My $watch functions show up as just "function ()" in the performance tab
+Use named functions for $watch:
+
+```javascript
+scope.$watch(function checkIfSomethingChanged() {
+ // ...
+}, function whenThatChanges(newValue, oldValue) {
+ // ...
+});
+```

0 comments on commit 460e43a

Please sign in to comment.