overleaf/services/web/public/coffee/main/project-list/left-hand-menu-promo-controller.coffee

20 lines
552 B
CoffeeScript
Raw Normal View History

define [
"base"
], (App) ->
App.controller 'LeftHandMenuPromoController', ($scope, UserAffiliationsDataService) ->
$scope.hasProjects = window.data.projects.length > 0
$scope.userHasNoSubscription = window.userHasNoSubscription
2016-11-29 09:38:25 -05:00
_userHasNoAffiliation = () ->
$scope.userEmails = []
$scope.userAffiliations = []
UserAffiliationsDataService.getUserEmails().then (emails) ->
$scope.userEmails = emails
for email in emails
if email.affiliation
$scope.userAffiliations.push email.affiliation
_userHasNoAffiliation()