I have a function I want to pass to a directive. The directive is used in two places, however, and at the first place the function takes two parameters, the second place it only takes one parameter:
Function1(param1)
Function2(param1, param2)
I only have access to param1 in the directive. How do I modify Function2 so that it returns Function1? I have thought about changing the implementation of Function2 to the following:
Function2(param2) {
return function(param1) {
//do something with param2
}
}
And passing it to the directive like this:
function="Function2(param2)"
However, this causes the Angular digest cycle to go into an infinite loop. How can I resolve this issue?