I have a ng-if condition:
<div class="fixed-outside" ng-if="'app.home'|isState">
i.e whenever the state is app.home show the div.
But I want to wait for some time before my div is shown. How can I do that
I'd suggest to do it with css and add animation with delay for .fixed-outside class. For instance, if you need to wait for 5 seconds before revealing block, you may do something like this:
.fixed-outside {
animation: 5s fadeIn;
visibility: hidden;
}
@keyframes fadeIn {
99% {
visibility: hidden;
}
100% {
visibility: visible;
}
}
You could try this: In your controller make a function that returns app.home but instead of returning it instantly wrap it inside a $timeout and replace on the view ng-if="'app.home'|isState" for the new function.
Something like:
controller
$scope.getAppHome = function(){
$timeout(function(){
return home; //or whatever var 'home' represents on the view 'app.home'
}, 200);
}
view
<div class="fixed-outside" ng-if="app.getAppHome()|isState">
home being initialized?