Search Posts

Category: angularjs-ng-include

Allowing multiple directives to transclude in a recursive template

I am currently receiving a tree of managers and their subordinates from the back end. I’m using a recursive template to display this. <script type=”text/ng-template” id=”managerTmp”> <div class=”accordion”> {{user.firstName}} {{user.lastName}} <ul class=”list-group” ng-if=”user.subordinates” > <li class=”list-group-item” ng-if=”user.subordinates” ng-repeat=”user in user.subordinates” ng-include=”‘managerTmp'”> </li> </ul> </div> </script> <div class=”col-lg-12″ ng-show=”section === 5″> <uib-accordion close-others=”oneAtATime” ng-show=”portal.acManagers && !spinning”> <ul class=”list-group” id=”1q2w3e”> <li class=”list-group-item” ng-repeat=”user in portal.acManagers” ng-include=”‘managerTmp'” ></li> </ul> </uib-accordion> </div> This all works fine and I get […]

Change ng-include with controller

I have a tab structure made of ng-reapet which shows the content of each tab in a panel (the same one but diff content). I have added <div ng-controller=”myCtrl”> <div ng-include=”‘tpl.html'”> </div> </div> in each tab-panel to display the content according to selected tab and its fine, but when i click on submit within the html(after filling the fields there) I want the ng-include to be replaced with another html (the submit results) template and […]

validate one ng-include inside a form

how to validate one ng-include inside a form How can I validate one ng-include at a time, <form name=”myform” ng-submit=”validateData()” novalidate=”novalidate”> <div> <div ng-include=”customtemplate”></div> </div> <div class=”center”> <input class=”btn buttonNewRequest” type=”submit” id=”submit” value=”Submit” /> <input class=”btn buttonNewRequest” type=”button” id=”reset” value=”Reset” /> </div> </form> I am using the two different templates dynamically using customtemplate, my problem is here, it’s validating both template same time. So how to restrict one template for validation at a time. Please […]