标签:
用AngularJS实现数据绑定实在太方便了(DOM 操作全依赖AngularJS):
<!DOCTYPE html> <html ng-app xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Simple app</title> <script src="http://apps.bdimg.com/libs/angular.js/1.2.16/angular.min.js"></script> </head> <body> <div ng-controller="MyController"> <h1>hello {{ clock }}!</h1> </div> <script type="text/javascript"> function MyController($scope, $timeout) { var updateClock = function () { $scope.clock = new Date(); $timeout(function () { updateClock(); }, 1000); }; updateClock(); }; </script> </body> </html>
标签:
原文地址:http://www.cnblogs.com/ByronWu12345/p/4783067.html