<body ng-app = "app" ng-controller = "wmxController">
<!--必须使用input和ng-model,且数据要相同-->
<input type="text" ng-model="name">
<p> {{name}} </p>
<script src="angular.js"></script>
<script>
var app = angular.module('app',[]);
app.controller('wmxController',['$scope',function ($scope) {
$scope.name = "小草莓";
}])
</script>
</body>
网友评论