此例子看alert弹出时的效果。当然,最重要的是ng-app="MyApp",这一个是怎么加载的。
<!DOCTYPE html> <html ng-app="MyApp"> <head> <title>Study 2</title> <script type="text/javascript" src="js/angular.js"></script> </head> <body> <div> 1 + 1 = {{1 + 1}} </div> <script type="text/javascript"> var app = angular.module("MyApp", [], function() { //console.log("Test"); alert("test"); }); </script> </body> </html>