Tuesday, January 30, 2018

write a program for AngularJS Applications

  • AngularJS modules define AngularJS applications.
  • AngularJS controllers control AngularJS applications.
  • The ng-app directive defines the application, the ng-controller directive defines the controller.


Program
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js">
</script>
</head>
<body>
<div ng-app="abc" ng-controller="def">
First Name: <input type="text" ng-model="firstname"><br>
Last Name:  <input type="text" ng-model="lastname"><br>
<br>
Full Name:{{firstname + " "+lastname}}
</div>

<script >
var app=angular.module('abc',[]);
app.controller('def',function($scope)
{
$scope.firstname ="RUSHI";
$scope.lastname="DAVE";

});
</script>
</body>
</html>

Output


0 comments:

Post a Comment

Thanks For Commented.

TechTalk