Answer: Yes we can have nested controllers. The thing is it works in a hierarchical way while using a View.
Example:
GrandFather ---- Father ---- Son
<div ng-controller="GrandFather">
<p>{{message}} {{name}}!</p>
<div ng-controller="Father">
<p>Hello {{name}}!</p>
<div ng-controller="Son">
<p>{{message}} {{name}}! Your username is {{username}}.</p>
</div>
</div>
</div>
Asked In: Many Interviews |
Alert Moderator