taiga-front/app/modules/home/working-on/working-on.directive.coffee

23 lines
619 B
CoffeeScript

WorkingOnDirective = (homeService, currentUserService) ->
link = (scope, el, attrs, ctrl) ->
user = currentUserService.getUser()
# If we are not logged in the user will be null
if user
userId = user.get("id")
ctrl.getWorkInProgress(userId)
return {
controller: "WorkingOn",
controllerAs: "vm",
templateUrl: "home/working-on/working-on.html",
scope: {},
link: link
}
WorkingOnDirective.$inject = [
"tgHomeService",
"tgCurrentUserService"
]
angular.module("taigaHome").directive("tgWorkingOn", WorkingOnDirective)