Angular — Directives: handling scope

Gerard Sans
AngularZone Community
1 min readNov 26, 2014

Angular directives introduction

When creating your directive you need to decide how are you going to handle scope. There are two options: isolated from the outside world, linked to the parent scope.

Isolated scope

Creates new scope but you CAN’T access $scope.$parent. This is the only option blocking access to the parent scope. All the other options below allow it, even scope: false.

Basic link (via $scope.$parent)

Creates new scope but you CAN access parent scope using $scope.$parent. This is the default option when no scope option is used and apparently is equal to scope: false.

Using DOM element attributes

One-way linked variable

Two-way linked variable

Calling an external function

More

If you want to master Angular filters continue reading on the post below

--

--

Gerard Sans
AngularZone Community

Helping Devs to succeed #AI #web3 / ex @AWSCloud / Just be AWSome / MC Speaker Trainer Community Leader @web3_london / @ReactEurope @ReactiveConf @ngcruise