main.html
<script src="main.js">
var app = angular.module('myApp', []);
</script>
<div ng-include="'login.html'"></div>
login.html
<script src="Components/LoginModule/LoginCtrl.js"></script>
<div ng-controller="LoginCtrl">
<form-field ng-field-data="{{login.usr_name}}"></form-field>
<form-field ng-field-data="{{login.password}}"></form-field>
</div>
i defined LoginCtrl controller in LoginCtrl.js, and want it to be loaded alongwith ng-include.
But i am facing following error
[$controller:ctrlreg] The controller with the name 'LoginCtrl' is not registered.
where as if i define my controller in main.html, it work perfectly fine