Search Posts

Category: ng-init

Can we delay rendering in angularjs until all variables get required values from callbacks

I have shared angularjs code. There IsShopToShowTerminated is always undefined and doesn’t depict the required value. I think problem is because, it renders first and then value of the IsShopToShowTerminated is changed. After search I am getting more and more confused. $scope.IsShopToShowTerminated = function(shopTerminationDate) { setTimeout(function() { debugger; if ($scope.IsTerminated($scope.viewCompany.TerminationDate)) { return true; } else { return $scope.IsTerminated(shopTerminationDate); } }, 0); } <td ng-init=”isTerminatedValue = IsShopToShowTerminated(shop.TerminatinonDate)”> {{isTerminatedValue}} <div ng-show=”isTerminatedValue”> <i class=”fa fa-circle text-danger”></i> <small>Terminated</small> </div> […]

How using ng-init in different ng-init?

I want to invoke some function by ng-init using parameters which are initializaing on another ng-init. At first i loaded some objects using function getAllObjects. <div id=”objects-list-container” ng-init=”getAllObjects()”> <%@include file=”objects-list.jspf”%> </div> After, i want to invoke function ng-init based on param from loaded recenty object. It looks like this: ng-init=”mapaStart({{object.cityName}}, {{object.street}}, {{$index}})” Div with above ng-init is a part of object-list.jspf file, so it’s a child for a div with ng-init=”getAllObjects()”. How can i do […]

angularjs and jquery conflict cause chrome stop responsing

<div class=”gridly-static”> <div id={{}} ng-repeat=”y in Categories” ng-init=”initCategories()”> <div class=”title”>{{}}</div> </div> </div> Categories variable is fetched from api service via $http.get(),and ng-init call initCategories is to reset the layout dynamically using jquery-gridly.The combination of two things make my chrome stop responding(The tab also can’t close at all) When I change the Categories to a object(don’t fetch from internet), the code works find. Also, When I don’t init the layout using $(‘xxx’).gridly(), it works too. I […]