B
B
beduin012016-08-03 15:16:34
Angular
beduin01, 2016-08-03 15:16:34

Angular: how to start rendering when a variable changes?

Although I write on Vue, few people here seem to know it. Therefore, I will ask how to do it on Angular. Essence.
You need to draw the list, but not immediately, but only when the value of the `rasters_previews_list` variable has changed (it has received data in itself)

<ul v-for="img in rasters_previews_list">
<li>{{img.id}}</li>
 <ul>

Now I have nothing displayed. at the time of application start rasters_previews_list is empty. How can I make the processing so that the loop is activated when data appears in it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
napa3um, 2016-08-03
@napa3um

https://docs.angularjs.org/api/ng/type/$rootScope....
But Vue doesn't have dirty checking and therefore doesn't require $apply, so maybe this link will help:
https://github .com/vuejs/vue/issues/483

M
Mikhail Osher, 2016-08-03
@miraage

ng-if="rasters_previews_list.length"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question