我使用ui-sref来改变dom上的状态。当用户点击此参考范围时,会破坏此案例的最佳做法。我不想将当前范围数据存储在某些数组或类似的东西中。这是我的代码;
<td class="v-middle">
<a ui-sref="app.customer-profile-details({id: '{{entry.profileId ? entry.profileId:0}}',
operation:'update'})">
<span class="text-primary">
<strong><u>{{entry.last_interaction | date:"MM/dd/yyyy h:mm"}}</u>
</strong></span>
</a>
</td>
.state('app.customer-profile-details', {
url: '/customer-profile-details',
templateUrl: 'views/customer-profiles/customer-profile-details.html',
controller: 'CustomerProfileDetailsController',
data: {
title: 'customer-profile-details.TITLE',
icon: 'icon-user',
link: null,
back: 'app.customer-profiles'
},
params: {id: null, operation: null},
resolve: load([])
我的上述状态的代码。谢谢。
答案 0 :(得分:0)
我建议您将状态存储在服务上而不是存储在范围
上