Angularjs Controller

Google Advertisements

AngularJS Directives AngularJS Expressions

Angularjs Controller

AngularJS applications are controlled by Controller. AngularJS controllers are used for control the data of AngularJS applications. AngularJS controllers are regular JavaScript Objects.

For define controller in AngularJS application we need ng-controller directive names

Example

<!DOCTYPE html>
<html>
<head>
<script src= "http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script>
</head>
<body>

<div ng-app="" ng-controller="AJSController">

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>
function AJSController($scope) {
    $scope.firstName = "Harry",
    $scope.lastName = "Porter"
}
</script>

</body>
</html>

Result

First Name:
Last Name:

Full Name: {{firstName + " " + lastName}}

In above example controller are use for conrtoller firstName and lastName. AngularJS will invoke personController with a $scope object.


AngularJS Directives AngularJS Expressions

Google Advertisements

Buy This Ad Space @$50 per Month, Ad Size 600X200 Contact on: hitesh.xc@gmail.com or 8076671483

Pure VPN Privide Lowest Price VPN Just @ $1.65. Per Month with Non Detected IP Lowest Price Non Detected IP VPN

Magenet is best Adsense Alternative here we earn $2 for single link, Here we get links ads. Magenet

Cloud computing is the on demand availability of computer system resources, especially data storage and computing power, without direct active management by the user. Cloud Computing Tutorial

College Projects Related to Java, AWT, C Projects for College, C++ Projects for College, Android Projects. Download Java C C++ Projects

Download Projects

Adsense Advertisements


Buy This ads Space 8076671483

Buy This Ad Space @$120 per Month, Ad Size 300X600 Contact on: hitesh.xc@gmail.com or 8076671483 Try this Keyword C++ Programs