Angular showing issue … not getting proper


I am new to angular JS. Please take a look. This is my app.js file


this is my controllers.js file

angular.module("CrudDemoApp.controllers", []);
controllers("MainController", function ($scope)
    $scope.message = "Main Controller";  

this is the my body part

<body ng-app="CrudDemoApp">
<div ng-controller="MainController">

firstly it is saying “Uncaught ReferenceError: controllers is not defined
at then it is saying
Error: [ng:areq]


angular.module("CrudDemoApp.controllers", []) //remove semicolon here adding the controller to this module
  .controller("MainController", function ($scope) // dot before controller, remove "s"
      $scope.message = "Main Controller";  

notice the dot and lack of pluralization on controller

You should have probably seen some other errors before the ones you mentioned always work from the first one down sometimes 1 error causes the next.

Answered By – shaunhusain

Answer Checked By – Gilberto Lyons (AngularFixing Admin)

Leave a Reply

Your email address will not be published.