[英]Changes disappear if I navigate away from page and comeback to that page - Ionic App
在我的离子应用程序中,我有一个页面,可以在其中编辑和保存信息。 信息之一是图像。 要选择新图像,它可以导航到包含要选择图像的页面。
因此,如果用户更改某些其他文本字段然后尝试更改图像,则他必须离开页面导航以选择新图像。 但是一旦选择图像后他又回来了,所有其他更改都消失了,并且又回到了旧数据上。
我希望用户返回页面后其他信息仍然存在。
这是我当前的代码:
<div class="content content-top content-bottom">
<ch-device-avatar ng-model="client" ch-size="xxlarge" ch-color="light"
ng-click="go(STATES.DEVICES_EDIT_ICON, {'macAddress': macAddress})">
<ch-avatar ch-icon="ion-edit" ch-size="small" ch-color="positive"></ch-avatar>
</ch-device-avatar>
</div>
<form id="client-form" class="form" name="forms.clientForm" ng-submit="save()" novalidate>
<label class="item item-input item-floating-label" ch-input-container>
<span class="input-label">{{ 'main.label-device-name' | i18n }}</span>
<input type="text" name="name" placeholder="{{ 'main.label-device-name' | i18n }}" autocomplete="off"
ng-model="client['name']" ng-maxlength="64" required>
</label>
<div ng-messages="forms.clientForm.name.$error" role="alert" ch-messages="name" multiple>
<div class="hint hint-error" ng-message="required">{{ 'common.error-required' | i18n }}</div>
<div class="hint hint-error" ng-message="maxlength">{{ 'common.error-max-length' | i18n:'65' }}</div>
</div>
</form>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.