Hi is it a good practice to have controller within a controller in angular?
For Example:
The body tag of my html has a controller called "CommonCtrl" within the html tag i'm loading a template using includes and inside the template i reuse the same controller.
Code:
Index.html
<body ng-controller="commonCtrl as vm">
<header data-ng-include="'app/includes/header.html'"></header>
<div ng-show="vm.showThisdiv">show this div</div>
</body>
header.html
<header id="header" ng-controller="commonCtrl as vm">
<span ng-show="vm.displayRegisterHeader" id="extr-page-header-space"> <span class="hidden-mobile">Already registered?</span> <a href="#/login" class="btn btn-danger">Sign In</a> </span>
<span ng-show="vm.displayLoginHeader" id="extr-page-header-space"> <span class="hidden-mobile">Need an account?</span> <a href="#/register" class="btn btn-danger">Create account</a> </span>
</header>