Ionic 1, how to reload a part of page, not the whole page

673 views Asked by At

I'm working in app using ionic 1, It's a social network app.

My problem is that I want to reload a value, not the whole page and I don't know how to do it.

This my example from my news feed: enter image description here

I want when I click like or comment the new value appear without reload all page.

For now I use:

$window.location.reload(true)

PS: When a user click in like, a new like add in database and the number of likes add +1, so when I reload page the new number of likes appear.

So again the problem is how to reload a part of page, not the whole page.

Thanks in advance

1

There are 1 answers

2
Vitor Hugo F. Lopes On

Ragnar, try to bind the like value in a $scope variable and then when the process to add the like in database is complete (process.then()..., for example) update the $scope variable.

If you are using an array to fill this, get the $index (generated by ng-repeat) and update only the $scope variable for the related item