In my custom directive, I need to access an the object $scope.$parent.users.
If I console.log $scope.$parent:
pillbox_directives.directive('scheduleCell', function(){
return {
restrict: 'EA',
link: function($scope, element, attrs){
console.log($scope.$parent);
}
}
});
...then the desired $parent is logged, and it contains an object 'users' as expected:
$$ChildScope: function b() {this.$$watchers=this.$$nextSibling=this.$$childHead=this.$$childTail=null;this.$$listeners={};this.$$listenerCount={};this.$$watchersCount=0;this.$id=++ob;this.$$ChildScope=null;}
$$childHead: n
$$childTail: n
$$listenerCount: Object
$$listeners: Object
$$nextSibling: null
$$prevSibling: null
$$watchers: Array[4]
$$watchersCount: 0
$id: 2
$parent: n
cloneDrop: function ($index) {
deadDrop: function ($index) {
generateSchedule: function (day) {
logOff: function () {
notSorted: function (obj) {
setup: Array[2]
users: Array[2]
__proto__: n
However, if I console.log($scope.$parent.users), it logs 'undefined'
Any ideas as to why I'm unable to access $scope.$parent.users in this way?