Answer the question
In order to leave comments, you need to log in
What is the best way to write behavior logic in Angular.js?
The bottom line is that there are 2 buttons to select something. And based on which button was pressed, the submit button should use the 1st or 2nd controller. Well, or one controller, but choose the 1st or 2nd address of the post request. Can this be done with angular or via if?
Answer the question
In order to leave comments, you need to log in
Actually, what prevents you from hanging a handler in the controller on each button and in this handler assigning one or another value to some variable from the scope of the controller, and when you need to submit the form, take the address from the scope parameter.
Or am I missing something in the question?
Can this be done with angular
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question