In Parent controller I am getting timer value in seconds and displaying it on Index page whose controller is "ParentController".
I have added one partial view using ui-view directive. Partial view's controller is "Child controller". In our case Parent controller $broadcast request to send timer value child controller.
On first attempt it works. But When you refresh page it does not broadcast timer value to child controller.
App.controller('**parentcontroller**', function ($scope, $http, $sce, $stateParams, $state, $modal, $timeout) {
$http.get('/home/getTimer').
success(function (data, status, headers, config) {
$scope.$broadcast('callTimeCountdown', {timer:data});
});
}
App.controller('**childcontroller**', function ($scope, $http, $sce, $stateParams, $state, $modal, $timeout) {
$scope.$on('callTimeCountdown', function (event, args) {
alert("In child controller");
});
}