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

Name all anonymous watch functions in Angular #1119

Closed
IgorMinar opened this issue Jul 6, 2012 · 2 comments
Closed

Name all anonymous watch functions in Angular #1119

IgorMinar opened this issue Jul 6, 2012 · 2 comments

Comments

@IgorMinar
Copy link
Contributor

Instead of:

$scope.$watch(function() { ... }, function() { ... });

we should use named functions everywhere, like this:

$scope.$watch(function fooWatch() {}, function fooWatchAction() {});

With the name in place, debugging using js debugger is easier and batarang can provide more useful output (e.g. in the perf tab).

@shyamseshadri
Copy link
Contributor

I have just sent a PR from my name-anonymous branch which does this.

@btford
Copy link
Contributor

btford commented Jul 19, 2012

+1. Cannot wait to use this in the debugger.

@mhevery mhevery closed this as completed in ca30fce Sep 6, 2012
mhevery pushed a commit to mhevery/angular.js that referenced this issue Sep 7, 2012
This will allow us to see function names in Batarang and debugger.

Closes angular#1119
mhevery pushed a commit that referenced this issue Sep 11, 2012
This will allow us to see function names in Batarang and debugger.

Closes #1119
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants