[angularJS]ng-hide|ng-show切换

<div class="row ng-scope">
    <div class="col-lg-12">
        <h1 class="page-header">详细信息</h1>
    </div>  
    <!-- /.col-lg-12 -->
</div>
<div class="panel panel-default">
<div class='panel-heading'>
    <div class="btn-group pull-right">
        <a ng-click="selectType=1" class="btn btn-primary btn-xs"><span class="glyphicon glyphicon-edit"></span></a>
        <a ng-click="selectType=0" class="btn btn-success btn-xs"><span class="glyphicon glyphicon-ok"></span></a>
    </div>个人资料
</div>
<div class="panel-body">
    <div class="row">
        <div class="col-lg-6 panel-body">
            <div class="form-group">
                <div style='position: relative;margin: 7px 13px;' class='todo-item' ng-hide="selectType" ng-class="{'todo-complete': item.complete}">
                    <p>{{user.model.username}}</p>
                </div>
                
                <div class='todo-item' ng-show="selectType">
                    <input type="text" class="form-control" ng-model="user.model.username" ng-class="{'todo-complete': item.complete}"/>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-lg-6 panel-body">
            <div class="form-group">
                <div style='position: relative;margin: 7px 13px;' class='todo-item' ng-hide="selectType">
                    <p>{{user.model.email}}</p>
                </div>
                
                <div class='todo-item' ng-show="selectType">
                    <input type="email" class="form-control" ng-model="user.model.email" required/>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-lg-6 panel-body">
            <div style='position: relative;margin: 7px 13px;' class='todo-item' ng-hide="selectType">
                <p>******</p>
            </div>
            
            <div class='todo-item' ng-show="selectType">
                <input type="password" ng-model="user.model.password" placeholder='Reset User password' required/>
            </div>
        </div>
    </div>
</div>

通过修改selectType切换ng-hide,ng-show改变内部文本

转载于:https://www.cnblogs.com/zaric/p/4322849.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值