zoukankan      html  css  js  c++  java
  • [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改变内部文本

  • 相关阅读:
    windows使用.NET CORE下创建MVC,发布到linux运行
    linux使用.net core 创建简单的MVC
    .net core 简单项目的创建
    Linux下配置mysql远程访问
    把二维码的图片和文字结合到一个背景图片上,合成一张图
    MvcPager帮助文档 — PagerOptions 类
    集合对象去重
    主键、外键
    SQL、T-SQL与PL-SQL的区别
    SqlServer 连接GreenPlum问题处理
  • 原文地址:https://www.cnblogs.com/zaric/p/4322849.html
Copyright © 2011-2022 走看看