wait time for the components to load and show page

0

Hi, I'm working on angularjs in a project that has included TWINESOCIAL in which I show social networks, this I have it in a section in the view:

<div class=""> <script id="twine-script" src="//apps.twinesocial.com/embed?app=prontoweb&showNav=yes&autoload=no"></script> </div>

and to get to it from another view I use:

$location.path('/Bienvenido'); $location.hash('feed');

this is assigned to the view controller with ng-click

the issue is that it loads very fast and does not allow loading javascript and throws me this error:

I researched and found in the library of angularjs $timeout but I do not know if it will help me, what do you recommend? Greetings.

    
asked by Hernan Humaña 05.01.2017 в 21:03
source

1 answer

1

I'll give you an example, when you give it a run after 5 seconds, the data variable in the scope is updated.

function TodoCtrl($scope, $timeout) {
  $timeout(function callAtTimeout() {
   $scope.datos='prueba';
}, 3000);
}
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<div ng-app>
  <div ng-controller="TodoCtrl">
  {{datos}}
  </div>
</div>

I use this in angular and it works in luxury.

Pd: I leave you the doc. official link $ timeout

    
answered by 05.01.2017 в 21:06