fmpq.com
源代码:
点击运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <script src="http://www.fmpq.com/jscss/jquery/1.4.6/angular.min.js"></script> </head> <body ng-app="myApp"> <div ng-controller="myCtrl"> <p>在输入框中输入一些信息:</p> <input type="text" ng-change="myFunc()" ng-model="myValue" /> <p>输入框已经修改了 {{count}} 次。</p> </div> <script> angular.module('myApp', []) .controller('myCtrl', ['$scope', function($scope) { $scope.count = 0; $scope.myFunc = function() { $scope.count++; }; }]); </script> </body> </html>
运行结果