码迷,mamicode.com
首页 > Web开发 > 详细

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

时间:2016-10-13 21:17:25      阅读:151      评论:0      收藏:0      [点我收藏+]

标签:

<!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:‘你好‘
};
}

]);

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

标签:

原文地址:http://www.cnblogs.com/qiyc/p/5958062.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!