Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Created by osbox on 21.07.2016.
- */
- angular.module('social-media-monitor').component('list', {
- templateUrl: 'app/directives/header/FaTwLi/list.html',
- controller: function ($location, $rootScope, FollowersService, GraphicsService, FiltersService, PostService) {
- var $ctrl = this;
- $ctrl.getFacebookFollowers = FollowersService.getFollowersCountForFacebook;
- $ctrl.getTwitterFollowers = FollowersService.getFollowersCountForTwitter;
- $ctrl.getLinkedInFollowers = FollowersService.getFollowersCountForLinkedIn;
- var currentDate = new Date();
- $ctrl.getQuery = FiltersService.getQuery;
- $ctrl.getQuery().endDate = currentDate;
- $ctrl.getQuery().startDate = currentDate;
- $ctrl.refresh = function () {
- console.log('Refreshing filters');
- if ($location.path() === '/posts') {
- PostService.refresh();
- }
- if ($location.path() === '/statistics') {
- GraphicsService.refresh();
- }
- };
- $ctrl.now = function () {
- return currentDate;
- };
- $ctrl.getDate = function () {
- return _maxDate;
- };
- /*
- Broadcasts to all application that data should be updated.
- */
- $ctrl.refreshAll = function () {
- console.log('Broadcasting refresh all message.');
- $rootScope.$broadcast('smmt:refreshAll');
- // TODO check if $state.reload() works as expected when other page functionalities are implemented
- };
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement