R
R
Roman Rakzin2020-06-20 22:32:10
Angular
Roman Rakzin, 2020-06-20 22:32:10

How to properly interact in markup with BehaviorSubject values ​​from the service?

As I understand it, it’s correct to create not just variables, but BehaviorSubject or Subject in the service and then refer to them in the markup, although when I changed the values, they were immediately drawn in the markup without it. But the question is different. I am deriving a value of type myserviceName.mydata.getValue() from the service,
but it does not work if I put it in input [model]. I did not understand how to properly pull out the data and enter it. You can make it through set, but in general I didn’t really understand the trick of these flows, when everything works and so, if I create variables and change them from different places (although this is not the best option, as I understand it)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question