How to create basic angularJS Example ?
First create module it contains have service, factory, controller and more. Here ng-app name is my application module name.
HTML
<html>
<head>
<title> My First Example </title>
</head>
<body>
<div ng-app="myFirstModule">
<div ng-controller="myFirstContoller">
{{name}}
</div>
</div>
<div ng-controller="myFirstContoller">
{{name}}
</div>
</div>
</body>
<html>
JavaScript:
<script type="text/javascript" src="js/angular.js"></script>
<script type="text/javascript">
var app = angular.module("myFirstModule",[]);
app.controller("myFirstContoller", function($scope){
$scope.name = "Welcome to angularJS";
});
app.controller("myFirstContoller", function($scope){
$scope.name = "Welcome to angularJS";
});
</script>
Nice Work...Its realy very Usefull To Me. Thank You....
ReplyDelete