diff options
| author | Misko Hevery | 2010-12-01 20:29:54 -0800 |
|---|---|---|
| committer | Misko Hevery | 2010-12-02 22:45:57 -0800 |
| commit | 5a8ad8fe329fc09898ff43a060710265d38393be (patch) | |
| tree | 95058036d40b1dd993e2a9c4094ebd34b2751707 /src/Compiler.js | |
| parent | 41d5938883a3d06ffe8a88a51efd8d1896f7d747 (diff) | |
| download | angular.js-5a8ad8fe329fc09898ff43a060710265d38393be.tar.bz2 | |
Closes #170. Corrected the behavior of select when options are ng:repeated
- Delete $postEval method, as it was a hack
Diffstat (limited to 'src/Compiler.js')
| -rw-r--r-- | src/Compiler.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/Compiler.js b/src/Compiler.js index 10d19ea8..a98bd502 100644 --- a/src/Compiler.js +++ b/src/Compiler.js @@ -30,6 +30,7 @@ Template.prototype = { if (this.newScope) { childScope = createScope(scope); scope.$onEval(childScope.$eval); + element.data($$scope, childScope); } foreach(this.inits, function(fn) { queue.push(function() { @@ -68,6 +69,17 @@ Template.prototype = { } }; +/* + * Function walks up the element chain looking for the scope associated with the give element. + */ +function retrieveScope(element) { + var scope; + while (element && !(scope = element.data($$scope))) { + element = element.parent(); + } + return scope; +} + /////////////////////////////////// //Compiler ////////////////////////////////// @@ -97,6 +109,7 @@ Compiler.prototype = { element = jqLite(element); var scope = parentScope && parentScope.$eval ? parentScope : createScope(parentScope); + element.data($$scope, scope); return extend(scope, { $element:element, $init: function() { |
