ProgrammerGuide.Net | Step by Step Programmer Guide

What is the Use of AngularJS Controllers ? | AngularJS Tutorial | AngularJS Interview Question | AngularJS Programmer Guide

AngularJS applications are controlled by controllers. The ng-controller directive defines the controller. The controller code will execute when the page loads.

AngularJS Controller by Example

<div ng-app=“” ng-controller=“personController”>

First Name: <input type=“text” ng-model=“firstName”><br>

Last Name: <input type=“text” ng-model=“lastName”><br>


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



function personController($scope) {

    $scope.firstName = “John”;

    $scope.lastName = “Doe”;



Please click here for related products on Amazon!


Add comment

Want to Check Celebrities News?