1、比较两个字符串是否相等
2、对象形式转化成json和json转化成字符串形式
3、便利对象遍历数组
4、绑定数据
5、多个app功能模块的实现
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Document</title>
</head>
<body>
<div ng-app="myApp" ng-controller="mycrl">
{{name }}
</div>
<div ng-app="myapp2" ng-controller="mycrl1" id="app2">
{{name}}
</div>
</body>
</html>
<script src="js/angurlar素材/angular/angular.js"></script>
<script>
var app =angular.module("myApp",[]);
app.controller("mycrl",function($scope){
$scope.name="嘎嘎嘎"
})
p(18)
});
var app1 =angular.module("myapp2",[]);
app1.controller("mycrl1",function($scope){
$scope.name="管管"
})
var myapp2 =document.querySelector("#app2");
//获取app节点
console.log(myapp2)
angular.bootstrap(myapp2,["myapp2"]);
//使用bootstrop("当前的节点",“当前节点名字”)
</script>
6、模块注入的方法
<div ng-app="myApp" ng-controller="mycrl">//定义一个模块指令
{{name }}
</div>
<script src="js/angurlar素材/angular/angular.js"></script>
<script>
var app =angular.module("myApp",["app1"]);//依赖注入自定义的app1
app.controller("mycrl",function($scope){
$scope.name="嘎嘎嘎"
})
p(18)
});
再新建一个js文件里面创建一个app模块指令
var app1 =angular.module("app1",[]);
app1.controller("mycrl1",function($scope){
$scope.name="管管"
})
这样在之前页面就可以调用这个模块了