angular/angular.js — pull request #2001 by dbrans (2013-02-12 21:51:50+00:00)
Title: feat($eval): simple assignments (without . or []) should overwrite closest definition...

... in parent scope chain. If no such definition exists, "declare" the variable on the current scope.

This PR makes angular scope work more like expected (more like ruby / coffeescript). I've taken care to check if scope is an isolate.

It feels a little wrong to put scope-specific functionality ($parent and $root) in parse.js, but when you think about it, parse has to have a concept of scope in order to provide $eval.

On a not unrelated note, as I try to wrap my head around angular, I've been using this model of angular world:

* A directive with an isolate is like a js library function defined in its own file. It's scope is lexically isolated.
* Transclusions are like closures passed to a library function (directive): when called/wrapped inside the library function a closure is bound to its "native" scope.

Feedback wanted, as always.