angularjs follows the MVC pattern, and use a hello world in convention
The code copy is as follows:
<html ng-app>
<head>
<script type="text/javascript" src="angular.min.js"></script>
<script type="text/javascript" src="controllers.js"></script>
</head>
<body>
<div ng-controller='HelloController'>
<p>{{greeting.text}}, world</p>
</div>
</body>
</html>
Content in controllers.js
The code copy is as follows:
function HelloController($scope) {
$scope.greeting = { text: "Hello"};
}
MVC feels very good to write~~