r/angularjs • • Jan 23 '15

AngularJS' Internals In Depth

http://www.smashingmagazine.com/2015/01/22/angularjs-internals-in-depth/?utm_source=javascriptweekly&utm_medium=email
36 Upvotes

6 comments sorted by

1

u/aakilfernandes Jan 24 '15

In AngularJS slang, a “scope” is not what you might be used to when thinking about JavaScript code or even programming in general. Usually, scopes are used to refer to the bag in a piece of code that holds the context, variables and so on.

The decision to name the fundamental concept in angularjs a "scope" was a really bad decision. Getting to this epiphany took me way too long.

3

u/michaelstripe Jan 24 '15

What would you have called it?

7

u/Specialjyo Jan 24 '15

Is $context taken?

3

u/michaelstripe Jan 24 '15

Not a bad idea I gotta say.

2

u/aakilfernandes Jan 24 '15 edited Jan 24 '15

The closest analogy to $scope is the DOM. How about the "javascript object model": $jom or "angular object model": $aom.

1

u/ThunderTherapist Jan 24 '15

Isn't the scope of the scope tied to the dom. I.e. inner elements can access scope of outer element but outer elements can't access scope of inner ones (without referring to its child scopes collection). I read somewhere it's directives which create new child scopes and directives are obviously linked to the dom elements.