A
A
alex_adept2015-04-12 03:20:57
JavaScript
alex_adept, 2015-04-12 03:20:57

How to initialize ng-select initial value depending on data from another controller?

Good afternoon. Such task:
There is a form which fasts through $http. It has one dropdown( select html ) which is tied to data from another angular controller. What is the correct way to initialize the initial selected element of this dropdown? So far, I have one option - to pass the data of the controller on which the active element depends via data-id to my current controller, and initialize it there. But
1. I initially feel that it is crooked and crutch
2. It does not work stably. Apparently due to the reason from point 1
Please tell me how to make such a multi-model form?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kano, 2015-04-13
@alex_adept

1. Nest controllers, let one become a parent, the other a child, or let them have a common parent controller.
2. Pass value through your service or value (value)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question