---
title: "Why AngularJs Controller is not Working proper?"  
description: "Why AngularJs Controller is not Working proper?"  
author: "Anonymous User"  
published: 2015-03-21  
updated: 2015-03-21  
canonical: https://www.mindstick.com/forum/23038/why-angularjs-controller-is-not-working-proper  
category: "angular js"  
tags: ["angularjs controller"]  
reading_time: 1 minute  

---

# Why AngularJs Controller is not Working proper?

Hi I’m new new in [Angularjs](https://www.mindstick.com/forum/33926/use-angularjs-without-scope-in-mvc) [library](https://www.mindstick.com/forum/34615/software-framework-vs-library) I’m begin to learn AngularJs [Controller](https://www.mindstick.com/blog/273/passing-values-from-controller-to-view-in-asp-dot-net-mvc) but my Controller is not work

**My AngularJs Controller [Code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii):**

```
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](https://www.mindstick.com/articles/1530/design-a-simple-stylish-calculator-using-html-css-and-javascript) 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](https://yourviews.mindstick.com/view/81399/tackling-the-problem-of-unemployment-during-corona-pandemic) I can’t understand please solve my problem as soon as possible.

[Thank you in Advance](https://answers.mindstick.com/qa/40482/why-was-1968-a-year-of-tension-and-turmoil-list-10-events-1-being-the-best-and-10-the-worst-thank-you-in-advance):

## Replies

### Reply by Anonymous User

You have missed the code for initialize angularjs application code

**Try this code:**

Controller Code:

This code write first line

var mainApp = angular.module("mainApp", []);

**Html Code:**

<div ng-app=" " ng-controller="employeeController">…</div>


---

Original Source: https://www.mindstick.com/forum/23038/why-angularjs-controller-is-not-working-proper

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
