I used two controllers in my angular module, but one is not working, I don't know what is wrong, I've browsed online for solution but I can't get what's wrong.
var app = angular.module('myWebsite', [])
app.controller('firstCtrl', function($scope) {
});
app.controller('secondCtrl', function($scope) {
});
<div ng-app="myWebsite">
<div ng-controller="secondCtrl">
</div>
</div>
The secondCtrl is giving me error in my console. This is the error code it's giving me: angular.js:124 Error: [$controller:ctrlreg] http://errors.angularjs.org/1.6.6/$controller/ctrlreg?p0=secondCtrl
I think you are new to angular Js, If you are running an angular app then mind the arrangements of cdn links. What is happening here is application don't know what is angular because it is compiling it before angular js library can be included which has its definition stored in it. So, when compiler don't know what the keyword is , it will throw error of
undefine.