javascript - How to animate ag-grid container with ng-include? -


i using ng-include dynamically load template in angular application. 1 of template has ag-grid.i using simple fade in fade out angular animation other templates animates ng-iclude, other template has ag-grid. following simplified problem having.

the animation work if removed ag-grid directive (<div ag-grid="gridoptions" class="ag-fresh" ></div>) in template script.

how solve problem?

aggrid.initialiseaggridwithangular1(angular);    var module = angular.module("example", ["aggrid", "nganimate"]);    module.controller("examplectrl", function($scope) {      var columndefs = [{headername: "make",field: "make"},      {headername: "model",field: "model"},      {headername: "price",field: "price"}    ];      var rowdata = [{make: "toyota", model: "celica",price: 35000},      {make: "ford",model: "mondeo",price: 32000},      {make: "porsche",model: "boxter",price: 72000}    ];      $scope.gridoptions = {      columndefs: columndefs,      rowdata: rowdata    };      $scope.url = null;      $scope.setdlg = function() {        if (!$scope.url)        $scope.url = 'test.html';      else        $scope.url = null;    }    });
#wrap {    width: 452px;    height: 200px;    position: absolute;    top: 50%;    left: 50%;    transform: translate(-50%, -50%);    background-color: red;    padding: 25px;  }    .ag-fresh{      position: relative;      height: 100%;  }    .animatestartupscreen.ng-enter,  .animatestartupscreen.ng-enter .model {    transition: 5000ms;    /*transition-delay: 1000ms;*/  }    .animatestartupscreen.ng-enter .model {    opacity: 0 !important;  }    .animatestartupscreen.ng-enter.ng-enter-active .model {    opacity: 1 !important;  }
<head>  <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.5/angular.min.js"></script>  <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.5/angular-animate.min.js"></script>  <script src="https://cdnjs.cloudflare.com/ajax/libs/ag-grid/6.3.0/ag-grid.js"></script>  </head>  <body ng-app="example" ng-controller="examplectrl">      <button type="" ng-click="setdlg()">show dialog</button>      <div ng-include="url" class="animatestartupscreen" style="overflow: hidden;"></div>        <script type="text/ng-template" id="test.html">        <div id="wrap" class="model">        <div ag-grid="gridoptions" class="ag-fresh" ></div>      </div>      </script>    </body>


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -