angular.js--demo2-----声明局部控制器controller

<!doctype html>
<html ng-app="HelloAngular">
<head>
<meta charset="utf-8">
</head>
<body>
<div ng-controller="helloAngular">
<p>{{greeting.text}},angular-demo2</p>
</div>
</body>
<script src="js/angular-1.3.0.js"></script>
<script src="HelloAngular_Module.js"></script>
</html>

HelloAngular_Module.js

var myModule= angular.module("HelloAngular",[]);
myModule.controller("helloAngular",['$scope',
function hell ($scope){
$scope.greeting = {
text:'你好'
};
}

]);

上一篇:Java的精确整数计算-Bigdecimal学习总结和工具类


下一篇:java web 实现文件夹上传(保留目录结构)