 ## Assigned to directive
 #############################################################################
 
-AssignedToDirective = ($rootscope) ->
+AssignedToDirective = ($rootscope, $confirm) ->
     #TODO: i18n
     template = _.template("""
         <% if (assignedTo) { %>


    return {link:link, require:"ngModel"}

module.directive("tgAssignedTo", ["$rootScope", AssignedToDirective])

        <% }); %>
    </div>""")

    link = ($scope, $el, $attrs, $model) ->
        editable = $attrs.editable?
        $scope.$watch $attrs.ngModel, (watcherIds) ->
            watchers = _.map(watcherIds, (watcherId) -> $scope.usersById[watcherId])
            html = template({watchers: watchers, editable:editable})
            $el.html(html)

        if not editable
            $el.find(".add-watcher").remove()
