- What is the reason that Angular does not allow two
ng-controller
directives on a single element and - What are some potential solutions for this issue - such as using custom directives or nesting HTML elements with a single
ng-controller
directive, among other options
For example:
<div ng-controller="ControllerOne as c1" ng-controller="ControllerTwo as c2">
{{ c1.value }}, {{ c2.value }}
</div>
Check out this JSFiddle example demonstrating setting two controllers on the same element.