I am trying to do the same because there is a function which is written in js controller method, and same thing i need to do in another method. So i don't want to write code again in that method as well. And we can't call one method inside another method in js controller, but we can do the same in js helper. So for reduce code i was trying to do that. I don't know it will be best practice or not. Please suggest me best way to do that.
Move that method from the controller into the helper. Helper exists to facilitate code reuse. Any code that you want to reuse should be moved to the helper. It then becomes easy because the controller can call the helper.
Thanks for reply,
I am trying to do the same because there is a function which is written in js controller method, and same thing i need to do in another method. So i don't want to write code again in that method as well.
And we can't call one method inside another method in js controller, but we can do the same in js helper.
So for reduce code i was trying to do that. I don't know it will be best practice or not.
Please suggest me best way to do that.