Skip to main content
2 of 3
deleted 20 characters in body
Jamal
  • 34.9k
  • 13
  • 133
  • 237

Accessing parent scope from directive

This is how I can access the exact scope value, otherwise it will be $scope.type of local scope.

I am accessing this from the template in NSPopover. NSPopover directive has scope: true.

It's also inside the Angular bootstrap module.

<label ng-class="{selected: $parent.$parent.$parent.type == current.type}" >
    <input type="radio" name="type" ng-value="current.type" ng-change="chooseOption()" ng-model="$parent.$parent.$parent.type"/>

...

vickk
  • 11
  • 1
  • 2