You can use ng-switch or ng-if. Ng-switch / ng-iff will actually remove everything inside it from the DOM until the condition is true.
For instance:
<li ng-repeat="ticket in data.tickets"> <div ng-click="openAddStartCal($event, ticket);ticket.openCal = !ticket.openCal" ng-hide="currentTicketUpdating == ticket.TicketId && currentParameterUpdating =='startCal' && startCalSaving == true"> <div ng-if="ticket.openCal"> <input type="text" starting-day="2" show-button-bar="false" show-weeks="false" class="form-control addTicketDateInput" datepicker-popup="dd MMM" ng-model="ticket.StartDate" ng-change="saveEditStartDate(ticket)" is-open="checkStartOpened(ticket)" min-date="" max-date="'2015-06-22'" datepicker-options="dateOptions" date-disabled="disabled(date, mode)" ng-required="true" close-text="Close" /> </div> </div> </li>
Note the addition of ticket.openCal = !ticket.openCal to an ng-click, and then using this in ng-if. (Btw, ig you have something useful for this in openAddStartCal, you can just use this.)
Alternatively, you can also use something like empty ng-include (until the line is clicked):
<li ng-repeat="ticket in data.tickets"> <div ng-click="openAddStartCal($event, ticket);ticket.openCal = !ticket.openCal" ng-hide="currentTicketUpdating == ticket.TicketId && currentParameterUpdating =='startCal' && startCalSaving == true"> <div ng-include=""></div> </li>
Then you set the ng-include variable when there is a click event.
source share