0

I'm using DayPilot Scheduler in my app and i'm having the following issue.

home.html:

<div class="container-fluid">
    <daypilot-scheduler id="scheduler" daypilot-config="schedulerConfig" daypilot-events="events"></daypilot-scheduler>
</div>

I access daypilot scheduler in my controller like this:

$scope.scheduler;

This works when daypilot directive is directly inside home.html like in home.html above, but returns undefined when I include daypilot with ng-include:

<div class="container-fluid">
    <div ng-include src="'partials/partial1.html'"></div>
</div>

partial1.html:

<section>   
    <daypilot-scheduler id="scheduler" daypilot-config="schedulerConfig" daypilot-events="events"></daypilot-scheduler>
</section>

If it's included with ng-include, $scope.scheduler returns undefined. scheduler is placed under $$childTail as $$childeTail.scheduler.

What am I doing wrong, and how can I access $$childTail?

MeesterPatat
  • 2,671
  • 9
  • 31
  • 54

1 Answers1

0

Try adding $parent. prefix to id attribute's value. So partial1.html will be:

<section>   
    <daypilot-scheduler id="$parent.scheduler" daypilot-config="schedulerConfig" daypilot-events="events"></daypilot-scheduler>
</section>

And in controller access it like you always did:

$scope.scheduler;
elink
  • 7
  • 1
  • 2