码迷,mamicode.com
首页 > Web开发 > 详细

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

时间:2015-03-09 10:39:40      阅读:168      评论:0      收藏:0      [点我收藏+]

标签:

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

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

标签:

原文地址:http://www.cnblogs.com/zaric/p/4322849.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!