O'Reilly logo

AngularJS Directives by Alex Vanston

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Scope = {}

For times when you want to have complete control over which properties and methods are interconnected within your new directive scope, an object hash is usually your best solution. This type of scoping is commonly referred to as an isolate scope, because of the lack of connectedness with the other scopes within the application. An empty object signifies that you want the new scope to be completely isolated from its parents, so nothing is inherited or carried over. If absolutely necessary, you can still access the parent or root scopes by using the $parent and $root properties, respectively, however this goes directly against our goals of modularity and thus should only be used when there's no better option.

While there are a few instances ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required