I'm fairly new to Angular and could use some help about the order in which things load.
I have two directives. A parent directive (resume-list) and a child directive (slick-slider). My problem is that the attribute (data-source-fn) of the child directive executes before the parent's controller where that fn is defined. This results in an error in the console = "Possibly unhandled rejection: undefined" - and the slides to the slick slider never load:
<resume-list>
<slick-slider
data-page-size="3"
data-scroll-size="3"
data-page-buffer="3 + 1"
data-total="slides.length"
data-config="resumeConfig"
data-theme="'theme-resume'"
data-slide-template-url="'app/widgets/slickSlider/resume-slide-tpl.html'"
data-source-fn="getResumeSlides(id, start, limit)">
</slick-slider>
</resume-list>
Now I've tried three different ways to solve this issue, but keep getting the same error. However, when I make the parent directive into a Component with typescript - everything works fine. So, my question is... is it possible to have the parent as a Directive that has the data to pass to it's child?
What I've tried for the Parent Directive:
1. Directive with Controller
2. Directive with no Controller but a (pre) link function instead
3. Directive with no Controller and a compile (pre) link function
All three of the above give me the same error: "Possibly unhandled rejection: undefined" .... which when I debug in the console the undefined object ends up being the data-source-fn...