In my current scenario, I am faced with a challenge involving a directive that has an isolated scope. My goal is to invoke a function from the parent's scope with a combination of arguments. By "mixed" arguments, I mean one argument originates from the directive while the other comes from the parent.
For the arguments provided by the directive, I could bind the function using `<
` and utilize it accordingly. On the other hand, for arguments supplied by the parent's scope, I could bind the entire function call using `&
`.
I am contemplating two possible approaches- firstly, to simulate currying by calling the function with the parent’s arguments, resulting in a function that accepts the directive's arguments. Secondly, finding a way to introduce directive variables into the parent's scope so that I can write:
<my-directive on-alarm="emergency(parent_var,dir_var)"/>
The latter option seems more appealing to me. However, I am uncertain about how to accomplish this task - specifically, how to introduce directive variables into the parent's scope without resorting to manual reverse binding methods such as:
<my-directive for_sake_of_calling="dir_var" on-alarm="emergency(parent_var,dir_var)"/>
Although these are just assumptions on my part, the crux of the matter remains: How can I call the parent's function with mixed arguments?