angularjs - How create datatables dynamically on button click in Angular Datatable? -


i using angular data table in project & want create data table dynamically in second form taking input's first form fields & on on clicking submit button of first form.

currently having 2 controllers. 1 controller each form. able broadcast 1st form submit using $scope.$broadcast in 1st controller & able capture broadcast event in 2nd controller. somehow not able create data table in 2nd controller without initializing data table in beginning of 2nd controller. mean have create data table in 2nd controller when page loads & dtinstance.rerender() when 1st form submitted. don't want create data table when page loads. in fact want create when user enters data in 1st form & submit click event.

use ng-if directive. wrap datatable directive inside ng-if directive. datatable directive executed when condition passes.

<div ng-if="firstformsubmitted" > <datatable></datatable> </div> 

Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -