AngularJS控制器

<body ng-app>
	<div ng-controller="myCtrl">
		<h1>{{say}}</h1>
		<h1>{{name()}}</h1>
	</div>
	<script>
		function myCtrl($scope) {
			$scope.say = 'hi,大家好';
			$scope.name = function () {
				return $scope.say + ',我叫Handsome!';
			}
		}
	</script>
</body>

  

posted @ 2016-12-08 11:58  HandsomeHan  阅读(133)  评论(0编辑  收藏  举报