Skip to content

Instantly share code, notes, and snippets.

@leongaban
Last active August 29, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leongaban/5e187a0c5b7159d18282 to your computer and use it in GitHub Desktop.
Save leongaban/5e187a0c5b7159d18282 to your computer and use it in GitHub Desktop.
temp app.js
/*global angular*/
/** ============================================================================
----------------------------------------------------------------------------- */
/**
* Main TickerTags Dashboard App module
* @namespace Controller
* @desc Injects all modules and controls the $rootScope
* @summary "Connecting trending social content to investable companies."
* @copyright TickerTags 2015
*/
/** ----------------------------------------------------------------------------
============================================================================= */
(function() { "use strict";
var app = angular.module('tickertags', [
'infinite-scroll',
'apiFactory',
'scopeFactory',
'tagFactory',
'tickerFactory',
'timeSpanFactory',
'overlayDirective',
'searchPopoverDirectives',
'notificationDirectives',
'platformHeaderDirectives',
'controlHeaderDirectives',
'viewHeaderDirectives',
'alertsPanelController',
'alertPanelDirectives',
'tickersPanelDirectives',
'tickersSelectFactory',
'tagsPanelDirectives',
'tagDetailsFactory',
'tagHoverDirective',
'tagSearchDirective',
'tagsFilterDirective',
'focusMeDirective',
'chartHeaderController',
'chartHeaderDirectives',
'chartPanelDirective',
'chartIQDirective',
'socialMediaController',
'socialMediaDirectives',
'socialMediaFactory'
])
.controller('DashCtrl', Controller);
Controller.$inject = [
'$scope',
'$rootScope',
'ScopeFactory',
'TickerFactory'];
function Controller($scope,
$rootScope,
ScopeFactory,
TickerFactory) {
/** Init DashCtrl scope */
/** ----------------------------------------------------------------- */
var vs = $scope;
vs.showNote = true,
vs.mouseX = '',
vs.mouseY = '';
ScopeFactory.saveScope('root', vs);
/** Detect if a tagHover has been shown and ready bodyClick to close */
vs.$on('tagHoverOpen', function(events,data) {
vs.bodyClick = function() {
$rootScope.$broadcast('bodyClick');
};
});
/** Remove eventListener after tagHover is closed */
vs.$on('destroy', function() {
vs.bodyClick = angular.noop();
});
/** Get and store all tickers, eventually just first 100 */
getAllTickers();
function getAllTickers() {
TickerFactory.getTickers();
};
};
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment