My custom directive needs to access the object $scope.$parent.users.
When I use console.log $scope.$parent:
myDirective.directive('scheduleItem', function(){
return {
restrict: 'EA',
link: function($scope, element, attrs){
console.log($scope.$parent);
}
}
});
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, when I try console.log($scope.$parent.users), it logs 'undefined'
Any thoughts on why I cannot access $scope.$parent.users in this way?