Controllers

Sunny.Sagar
Posted by Sunny.Sagar under AngularJS category on | Points: 40 | Views : 387

<script>
var myApp = angular.module('myApp', []);
myApp.controller('MyController', function($scope) {
$scope.FirstName = 'Sagar';
$scope.LastName = 'Varma';

$scope.FullDetails = function () {
return $scope.FirstName + ' ' + $scope.LastName;
};
});
</script>
<body ng-app="myApp">
<div ng-controller="MyController">
First name: {{ FirstName }} Last Name:{{ LastName }}
<p>Full name is {{ FullDetails() }}</p>
</div>

Comments or Responses

Login to post response