aboutsummaryrefslogtreecommitdiffstats
path: root/src/Angular.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/Angular.js')
-rw-r--r--src/Angular.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/Angular.js b/src/Angular.js
index 0952a352..2d67b2cb 100644
--- a/src/Angular.js
+++ b/src/Angular.js
@@ -313,8 +313,10 @@ function merge(src, dst) {
function compile(element, parentScope, overrides) {
var compiler = new Compiler(angularTextMarkup, angularAttrMarkup, angularDirective, angularWidget);
- $element = jqLite(element);
- return compiler.compile($element)($element, parentScope, overrides);
+ $element = jqLite(element),
+ parent = extend({}, parentScope);
+ parent.$element = $element;
+ return compiler.compile($element)($element, parent, overrides);
}
/////////////////////////////////////////////////
@@ -340,6 +342,8 @@ function toKeyValue(obj) {
function angularInit(config){
if (config.autobind) {
- compile(window.document, null, {'$config':config}).$init();
+ var scope = compile(window.document, null, {'$config':config});
+ scope.$browser.addCss('../css/angular.css');
+ scope.$init();
}
}