         <% }); %>
     </div>""")
 
-    renderWatchers = ($scope, $el, watcherIds, editable) ->
-        watchers = _.map(watcherIds, (watcherId) -> $scope.usersById[watcherId])
-        html = template({watchers: watchers, editable:editable})
-        $el.html(html)
-
     link = ($scope, $el, $attrs, $model) ->
         editable = $attrs.editable?
         $scope.$watch $attrs.ngModel, (watcherIds) ->
-            renderWatchers($scope, $el, watcherIds, editable)
+            watchers = _.map(watcherIds, (watcherId) -> $scope.usersById[watcherId])
+            html = template({watchers: watchers, editable:editable})
+            $el.html(html)
 
         if not editable
             $el.find(".add-watcher").remove()

## Assigned to directive
#############################################################################

AssignedToDirective = ($rootscope) ->
    #TODO: i18n
    template = _.template("""
        <% if (assignedTo) { %>

        </div>
    """)

    link = ($scope, $el, $attrs, $model) ->
        editable = $attrs.editable?

        $scope.$watch $attrs.ngModel, (assignedToId) ->
            assignedTo = null
            assignedTo = $scope.usersById[assignedToId] if assignedToId?
            html = template({assignedTo: assignedTo, editable:editable})
            $el.html(html)

        $el.on "click", ".icon-edit", (event) ->
            event.preventDefault()
