Users Pricing

forum

home / developersection / forums / why angularjs controller is not working proper?

Why AngularJs Controller is not Working proper?

Anonymous User 2627 21 Mar 2015

Hi I’m new new in Angularjs library I’m begin to learn AngularJs Controller but my Controller is not work

My AngularJs Controller Code:

mainApp.controller('employeeController', function ($scope) {
        $scope.employee = {
            firstName: "Kamlakar",
            lastName: "Singh",
            fullName: function () {
                var studentObject;
                employeeObject = $scope.employee;
                return employeeObject.firstName + " " + employeeObject.lastName;
            }
        };
    });

My AngularJs Html Code:

<div ng-app=" " ng-controller="employeeController">
 
Enter first name: <input type="text" ng-model="employee.firstName"><br><br>
Enter last name: <input type="text" ng-model="employee.lastName"><br>
<br>
You are entering: {{employee.fullName()}}
</div>

Where is problem I can’t understand please solve my problem as soon as possible.

Thank you in Advance:


I am a content writter !


1 Answers

Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md