AngularJS-2 : Module and Controller
angular.min.js
-------------------------------------
Script.js
------------------------------------
/// <reference path="angular.min.js" />
var myAppModule = angular.module("myAppModule",[]);
var myDataController = function ($scope) {
$scope.message = "Angular JS Tutorial"; //dummy data, in real time model will be binded to $scope
};
myAppModule.controller("myDataController", myDataController);
myHTML.html
------------------------------------
<!DOCTYPE html>
<html ng-app="myAppModule">
<head>
<script type="text/javascript" src="resources/js/angular.min.js"></script>
<script type="text/javascript" src="resources/js/Script.js"></script>
</head>
<body ng-controller="myDataController">
<div>
{{ message }}
</div>
</body>
</html>


No comments:
Post a Comment