mvc结构
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>angularjs</title>
<style>
*{
font-family: 微软雅黑;
}
</style>
<link rel="stylesheet" href="bs/css/bootstrap.min.css">
<script src="bs/js/jquery.min.js"></script>
<script src="bs/js/bootstrap.min.js"></script>
<script src="ng/angular.min.js"></script>
</head>
<body ng-app='myapp' ng-controller='myctl'>
<div class="container">
<h1 class="page-header">angular框架</h1>
<!-- mvc -->
<div class="form-group">
<label for="">用户名:</label>
<input type="text" class="form-control" ng-model='username'>
</div>
<div class="well">用户名: {{username}}</div>
<div class="form-group">
<label for="">密码:</label>
<input type="text" class="form-control" ng-model='password'>
</div>
<div class="well">密码: {{password}}</div>
</div>
</body>
<script>
app=angular.module('myapp',[]);
app.controller('myctl',function($scope,$timeout){
$scope.username='user123';
$timeout(function(){
$scope.username='user456';
},2000);
});
</script>
</html>