Cannot find controller with name MyController

Cannot find controller with name MyController

If you have just created new page using AngularJS and getting error Cannot find controller with name MyController means you have not initialize your new controller yet as shown below:

Cannot find controller with name MyController

Cannot find controller with name MyController

  • To fix this issue please initialize controller as below:

2 thoughts on “Cannot find controller with name MyController

  1. Hi,
    I am getting cannot find module and also cannot find controller error and also multiple file annotations error.Please help .

    My file:

    var validation = angular.module(‘my’, []);
    validation.controller(‘mycontroller’ , function($scope) {
    $scope.firstName = “madhuri”;
    $scope.email = “madhuri@gmail.com”;
    $scope.age = “24”;
    $scope.pattern = /^\d*$/;
    });

    Name :
    please provide the name

    Email:
    please provide the valid email address
    <!– please provide the valid email address –>

    age :

    please provide the correct age

    Thanks,

  2. Hi,

    I am getting cannot find controller with name and also cannot find module as well as multiple annotions found at this line.

    Please help
    My code :

    var validation = angular.module(‘my’, []);
    validation.controller(‘mycontroller’ , function($scope) {
    $scope.firstName = “madhuri”;
    $scope.email = “madhuri@gmail.com”;
    $scope.age = “24”;
    $scope.pattern = /^\d*$/;
    });

    Name :
    please provide the name

    Email:
    please provide the valid email address
    <!– please provide the valid email address –>

    age :

    please provide the correct age

Leave a Reply

Your email address will not be published. Required fields are marked *