From 460e43aad1dd89880d2c90ff64fbc4e6651498ef Mon Sep 17 00:00:00 2001 From: Brian Ford Date: Tue, 1 Jan 2013 11:31:33 -0500 Subject: [PATCH] add note about named watch functions to FAQ --- FAQ.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/FAQ.md b/FAQ.md index 6e7e893..cd3d5b8 100644 --- a/FAQ.md +++ b/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) { + // ... +}); +```