AngularJS 의 컨트롤 러 예제

755 단어 AngularJS
<!doctype html>

<html ng-app="myApp">

	<head>

		<script src="C:\\Users\\yuli\\Desktop\\bower_components\\angularjs\\angular.js"></script>

		<script type="text/javascript">

			angular.module('myApp', []).controller('MyController', function ($scope, $timeout) {

				var updateClock = function() {

					$scope.clock = new Date();

					$timeout(function() {

						updateClock();

					}, 1000);

				};

				updateClock();

			});

		</script>

	</head>

	<body>

		<div ng-controller="MyController">

			<h1>Hello {{ clock }}!</h1>

			  AngularJS     。

		</div>

	</body>

</html


좋은 웹페이지 즐겨찾기