Angularjs鼠标中键点击时范围分散

Angularjs when middle mouse button clicked scope dispersed

本文关键字:范围 分散 鼠标中键 Angularjs      更新时间:2023-09-26

我使用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([])

我上面的状态代码。非常感谢。

我建议您将状态存储在服务上,而不是存储在作用域上