<link rel="stylesheet" href="/css/bootstrap/bootstrap3.3.7.min.css">
<script src="/js/angular.js1.4.6/angular.min.js"></script>
<body ng-app="myApp" ng-controller="userCtrl">
<table class="table table-striped">
<tr ng-repeat="user in users">
<button class="btn" ng-click="editUser(user.id)">
<span class="glyphicon glyphicon-pencil"></span>编辑
<td>{{ user.fName }}</td>
<td>{{ user.lName }}</td>
<button class="btn btn-success" ng-click="editUser('new')">
<span class="glyphicon glyphicon-user"></span>创建新用户
<h3 ng-show="edit">创建新用户:</h3>
<h3 ng-hide="edit">编辑用户:</h3>
<form class="form-horizontal">
<label class="col-sm-2 control-label">名:</label>
<input type="text" ng-model="fName" ng-disabled="!edit" placeholder="名">