【发布时间】:2017-08-01 17:22:12
【问题描述】:
在我的 ionic 应用程序中,我有一个可以编辑和保存信息的页面。信息之一是图像。要选择新图像,它旨在导航到包含要从中选择的图像的页面。
因此,如果用户更改了其他一些文本字段,然后尝试更改图像,他必须离开页面以选择新图像。但是一旦他在选择图像后返回,所有其他更改都消失了,它又回到了旧数据。
我希望在用户返回页面后保留其他信息。
这是我当前的代码:
<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>
【问题讨论】:
标签: javascript ionic-framework