diff options
| author | Misko Hevery | 2010-01-24 17:10:58 -0800 |
|---|---|---|
| committer | Misko Hevery | 2010-01-24 17:10:58 -0800 |
| commit | efad9ec5be8da442af5fb3dffc08510f7a71e10f (patch) | |
| tree | b6ffdda829b47b9058f0b2ccbd6ef3465ccfe0bc /src/Scope.js | |
| parent | c7719c24121b500f0bc2ac7c652d8ec0de418a37 (diff) | |
| download | angular.js-efad9ec5be8da442af5fb3dffc08510f7a71e10f.tar.bz2 | |
changes to make it closure compiler compatible
Diffstat (limited to 'src/Scope.js')
| -rw-r--r-- | src/Scope.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/Scope.js b/src/Scope.js index dcc50007..3b1f3930 100644 --- a/src/Scope.js +++ b/src/Scope.js @@ -6,9 +6,9 @@ function Scope(initialState, name) { var State = function(){}; State.prototype = initialState; this.state = new State(); - this.state.$parent = initialState; + this.state['$parent'] = initialState; if (name == "ROOT") { - this.state.$root = this.state; + this.state['$root'] = this.state; } }; @@ -37,7 +37,7 @@ Scope.getter = function(instance, path) { } } } - if (typeof instance === 'function' && !instance.$$factory) { + if (typeof instance === 'function' && !instance['$$factory']) { return bind(lastInstance, instance); } return instance; @@ -69,10 +69,12 @@ Scope.prototype = { }, get: function(path) { +// log('SCOPE.get', path, Scope.getter(this.state, path)); return Scope.getter(this.state, path); }, set: function(path, value) { +// log('SCOPE.set', path, value); var element = path.split('.'); var instance = this.state; for ( var i = 0; element.length > 1; i++) { @@ -145,9 +147,9 @@ Scope.prototype = { return expression(self)(self, value); }, - entity: function(entityDeclaration) { + entity: function(entityDeclaration, datastore) { var expression = new Parser(entityDeclaration).entityDeclaration(); - return expression({scope:this}); + return expression({scope:this, datastore:datastore}); }, markInvalid: function(widget) { |
