加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

angularjs – 有条件的角度/离子添加属性

发布时间:2020-12-17 16:56:09 所属栏目:安全 来源:网络整理
导读:我想使用 angularjs有条件地添加滑动功能, 我在控制器中有’customerview’和’kycview’范围变量. $scope.customerview = 'customerview';$scope.kycview = 'kycview'; 我想删除/隐藏’on-swipe-right’和’on-swipe-left’,如果视图是’kycview’ 如何为启
我想使用 angularjs有条件地添加滑动功能,

我在控制器中有’customerview’和’kycview’范围变量.

$scope.customerview = 'customerview';
$scope.kycview = 'kycview';

我想删除/隐藏’on-swipe-right’和’on-swipe-left’,如果视图是’kycview’

如何为启用和禁用写条件语句?

模板

<ion-tabs class="tabs-striped tabs-positive">
        <ion-tab id="personalDetails" title="Personal" href="#/newcustomer/PersonalDetails" class="{{persDetailsComplete}}">
            <ion-nav-view name="newcustomer-PersonalDetails"></ion-nav-view>
        </ion-tab>
        <ion-tab id="familyDetails" title="Family &amp; Housing" href="#/newcustomer/FamilyDetails" class="{{familyDetailsComplete}}" disabled="customerState != 'customerview'" on-swipe-right="goBack()" on-swipe-left="goForward()">
            <ion-nav-view name="newcustomer-FamilyDetails"></ion-nav-view>
        </ion-tab>
        <ion-tab id="idproof" title="ID Proof" href="#/newcustomer/Idproof"  class="{{idProofComplete}}" disabled="customerState != 'customerview'">
            <ion-nav-view name="newcustomer-Idproof"></ion-nav-view>
        </ion-tab>              
        <ion-tab title="Address" href="#/newcustomer/Address" ng-click="getNewAddress(3);" ng-controller="CustomerController"  class="{{addressComplete}}" disabled="customerState != 'customerview'">
            <ion-nav-view name="newcustomer-Address"></ion-nav-view>
        </ion-tab>       
        <ion-tab title="Employment" href="#/newcustomer/EmploymentDetails" class="{{employeementComplete}}" disabled="customerState != 'customerview'">
            <ion-nav-view name="newcustomer-EmploymentDetails"></ion-nav-view>
        </ion-tab>
        .................
        .................


    </ion-tabs>

解决方法

<ion-tab id="familyDetails" title="Family &amp; Housing" href="#/newcustomer/FamilyDetails" class="{{familyDetailsComplete}}" on-swipe-right="goBack()"  on-swipe-left="goForward()" ng-if="view=='kycview' &&customerview=='kycview'" >

<ion-tab id="familyDetails" title="Family &amp; Housing" href="#/newcustomer/FamilyDetails" class="{{familyDetailsComplete}}" on-swipe-right="goBack()" on-swipe-left="goForward()">

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读