aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorIgor Minar2011-02-04 13:29:24 -0800
committerIgor Minar2011-02-04 14:11:52 -0800
commitbf7c9d9900ba78a2c881caacc4be9ab43469663e (patch)
tree7457e47222b0426117dc9092ee16d0f064f4c39a /src
parent568574b915086bcb1f08e3f8903ef79497c97435 (diff)
downloadangular.js-bf7c9d9900ba78a2c881caacc4be9ab43469663e.tar.bz2
$route.onChange should return the registered fn
Diffstat (limited to 'src')
-rw-r--r--src/services.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/services.js b/src/services.js
index b7e7c02f..eb0a473f 100644
--- a/src/services.js
+++ b/src/services.js
@@ -709,11 +709,15 @@ angularServiceInject('$route', function(location) {
* @methodOf angular.service.$route
*
* @param {function()} fn Function that will be called when `$route.current` changes.
+ * @returns {function()} The registered function.
*
* @description
* Register a handler function that will be called when route changes
*/
- onChange: bind(onChange, onChange.push),
+ onChange: function(fn) {
+ onChange.push(fn);
+ return fn;
+ },
/**
* @workInProgress