aboutsummaryrefslogtreecommitdiffstats
path: root/src/service/scope.js
diff options
context:
space:
mode:
authorVojta Jina2012-03-18 23:46:30 -0700
committerVojta Jina2012-03-18 23:46:30 -0700
commit192ff61f5d61899e667c6dbce4d3e6e399429d8b (patch)
tree2f5b4cd83b05a28e444ea1bac3c6bc7e3aeefa92 /src/service/scope.js
parent935c1018da05dbf3124b2dd33619c4a3c82d7a2a (diff)
downloadangular.js-192ff61f5d61899e667c6dbce4d3e6e399429d8b.tar.bz2
feat(scope.$eval): Allow passing locals to the expression
Diffstat (limited to 'src/service/scope.js')
-rw-r--r--src/service/scope.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/service/scope.js b/src/service/scope.js
index 09454bfb..4cf6a3e0 100644
--- a/src/service/scope.js
+++ b/src/service/scope.js
@@ -503,12 +503,13 @@ function $RootScopeProvider(){
* @param {(string|function())=} expression An angular expression to be executed.
*
* - `string`: execute using the rules as defined in {@link guide/dev_guide.expressions expression}.
- * - `function(scope)`: execute the function with the current `scope` parameter.
+ * - `function(scope, locals)`: execute the function with the current `scope` parameter.
+ * @param {Object=} locals Hash object of local variables for the expression.
*
* @returns {*} The result of evaluating the expression.
*/
- $eval: function(expr) {
- return $parse(expr)(this);
+ $eval: function(expr, locals) {
+ return $parse(expr)(this, locals);
},
/**