Angularjs Controller

Prev Tutorial Next Tutorial

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


<!DOCTYPE html>
<script src= ""></script>

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

First Name: <input type="text" ng-model="firstName"><br>
Last Name: <input type="text" ng-model="lastName"><br>
Full Name: {{firstName + " " + lastName}}


function AJSController($scope) {
    $scope.firstName = "Harry",
    $scope.lastName = "Porter"



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.

Prev Tutorial Next Tutorial

Google Advertisements
Download Projects

Google Adsense Advertisements

Buy 3 Year Old Domain,, @$200

Buy This Ad Space @$50 per Month, Ad Size 300X250 Contact on: WhatsApp no. 8882538826

Yahoo Advertisements