[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改变内部文本

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。