diff options
| author | Misko Hevery | 2010-04-03 17:04:36 -0700 |
|---|---|---|
| committer | Misko Hevery | 2010-04-03 17:04:36 -0700 |
| commit | a80a61839a66d244c8bb14bbe2975746e02516c8 (patch) | |
| tree | 5a7b4d9d3e2a7a15ebf55e068782fbf2aa4ac6bf /src/Compiler.js | |
| parent | 35ca4fcb9c49e505e28669e951e01ddedb01d7db (diff) | |
| download | angular.js-a80a61839a66d244c8bb14bbe2975746e02516c8.tar.bz2 | |
injection is now working
Diffstat (limited to 'src/Compiler.js')
| -rw-r--r-- | src/Compiler.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/Compiler.js b/src/Compiler.js index c9039928..dac4931f 100644 --- a/src/Compiler.js +++ b/src/Compiler.js @@ -1,5 +1,5 @@ /** - * Template provides directions an how to bind to a given element. += * Template provides directions an how to bind to a given element. * It contains a list of init functions which need to be called to * bind to a new instance of elements. It also provides a list * of child paths which contain child templates @@ -43,7 +43,7 @@ Template.prototype = { }, empty: function() { - return this.inits.length == 0 && this.paths.length == 0; + return this.inits.length === 0 && this.paths.length === 0; } }; @@ -63,8 +63,9 @@ Compiler.prototype = { var template = this.templatize(rawElement) || new Template(); return function(element, parentScope){ element = jqLite(element); - parentScope = parentScope || {}; - var scope = createScope(parentScope); + var scope = parentScope && parentScope.$eval ? + parentScope : + createScope(parentScope || {}, angularService); return extend(scope, { $element:element, $init: function() { @@ -161,7 +162,7 @@ function eachNode(element, fn){ function eachAttribute(element, fn){ var i, attrs = element[0].attributes || [], size = attrs.length, chld, attr, attrValue = {}; for (i = 0; i < size; i++) { - var attr = attrs[i]; + attr = attrs[i]; attrValue[attr.name] = attr.value; } foreach(attrValue, fn); |
