K
K
koliane2017-11-04 16:38:20
JavaScript
koliane, 2017-11-04 16:38:20

How can js access data from an angular model?

How can js access data from an angular model?
I have an area. When you click on a certain shape in this very canvas, an event is fired and I somehow need to contact the angular application.
For example, I have 5 squares drawn on canvas. When you click on a certain square, fields (tags, input...) appear with certain parameters specifically for the selected square. Fields with parameters are just displayed and stored through angular/ So, how, when clicking on a certain square, can I contact angular to display the necessary parameters?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrew, 2017-11-04
@byte916

The canvas must be inside the angular controller. Hang an ng-click event on the squares. Hang the corresponding ng-model on the appearing fields. With ng-click, change visibility and update the field model.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question