The controller with the name 'mainController' is not registered

前端 未结 5 1244
死守一世寂寞
死守一世寂寞 2021-01-04 22:47

i have this code in my script.js file

var mainController = function($scope){
  $scope.message = \"Plunker\";
};

and this is my HTML

5条回答
  •  情深已故
    2021-01-04 23:48

    In case you have your code correct and still getting this error then look in the Console (JS Console) in the browser using inspect window for another JS error shown. Most propably that error will be before this error.

    If you solve that JS error then this will get resolved automatically if your code is right. In my case I started getting this error out of the sudden and tried to solve it but nothing work and then I try something else for sometime and saw another error above this error and tried solving it. That was a easy thing to solve and once done this error also got solved by itself.

提交回复
热议问题