当前位置: 首页 > 工具软件 > ng-book 2 > 使用案例 >

Angular学习(2)- ng-app

淳于健
2023-12-01

此例子看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>

 

转载于:https://www.cnblogs.com/HD/p/3630717.html

 类似资料: