简体   繁体   English

如何在Onsen UI(angularjs)中更新数据

[英]How to update data in Onsen UI (angularjs)

I am working in an app with onsen ui + phonegap. 我正在使用带有ui ui + phonegap的应用程序。 Then I have a page that user click to favorite the post. 然后我有一个页面,用户单击该页面可收藏该帖子。 This page has the last 4 photos of people who favorited the post recently. 本页包含最近喜欢此帖子的人的最后4张照片。 Then I already add the class "active" to button favorite. 然后,我已经将“活动”类添加到按钮收藏夹。 But now the problem: How can I update data of last 4 people who favorited the post to appear the user photo? 但是现在的问题是:如何更新喜欢该帖子的最近4个人的数据以显示用户照片? This data is in an angular service. 该数据在角度服务中。 And this is how I get it in template: 这就是我在模板中得到它的方式:

<ons-col ng-repeat="pe in people | limitTo: 4">

Does someone can help me? 有人可以帮我吗?

Thanks 谢谢

I guess you are using ons-navigator . 我猜您正在使用ons-navigator If you are pop ing a page, the previous page would not be created from scratch. 如果要pop页面,则不会从头开始创建上一页。

If you need to recreate the previous page, pass {refresh: true} as a parameter to the nav.popPage . 如果需要重新创建上一页,请将{refresh: true}作为参数传递给nav.popPage

nav.popPage({refresh: true});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM