Having a bit of an issue, I have a page which gets routed into ng-view via a page transition. The problem is that I have a slideshow gallery which needs to be built before displaying the page.. cant seem to find a way of delaying the page transition.. I Ive read something about ngCloak and tried to put it on my home page template but doesnt seem to do anything...
Hope you guys can put me in the right direction..
homeController.js
angular.module("sportsStore")
.controller("homeCtrl", function ($scope) {
$scope.pageClass = 'page-home';
$scope.quantity = 4;
})
homeCtrl.slider = function ($timeout) {
return {
templateUrl: "AngularJS/views/sliderTemplate.html",
compile: function compile(tElement, tAttrs, transclude) {
return function (scope, element, attrs) {
$timeout((function() {
return element.flexslider({
animation: "slide",
controlNav: false,
directionNav: true,
nextText: "<i class='fa fa-angle-right'></i>",
prevText: "<i class='fa fa-angle-left'></i>",
});
}), 0);
}
}
}
};
Routes
.config(function ($routeProvider) {
$routeProvider.when("/complete", {
templateUrl: "AngularJS/views/thankYou.html"
});
$routeProvider.when("/placeorder", {
templateUrl: "AngularJS/views/placeOrder.html"
});
$routeProvider.when("/checkout", {
templateUrl: "AngularJS/views/checkoutSummary.html"
});
$routeProvider.when("/products", {
templateUrl: "AngularJS/views/productList.html",
controller: "productListCtrl"
});
$routeProvider.otherwise({
templateUrl: "AngularJS/views/homeView.html",
controller: "homeCtrl"
resolve: homeCtrl.slider
});
})