     """) # TODO: i18n
 
     link = ($scope, $el, $attrs, $model) ->
+        $ctrl = $el.controller()
+
         render = (attachment, isEditable=false) ->
             ctx = {
                 id: attachment.id

## Attachment Directive
#############################################################################

AttachmentDirective = ($log) ->
    singleAttachment = _.template("""
    <div class="attachment-name">
        <span class="icon.icon-document"></span>

    </div>
    <div class="editable editable-attachment-comment">
        <span class="attachment-size">(<%- size %>)</span>
        <input type="text" name="description"
               value="<%- description %>""
               placeholder="Type a short description" />
    </div>
    <div class="editable editable-attachment-deprecated">
        <input type="checkbox" name="is-deprecated" id="attach-<%- id %>-is-deprecated"
               <% if (isDeprecated){ %>checked<% } %> />
        <label for="attach-<%- id %>-is-deprecated">Deprecated?</label>
    </div>
    <a class="editable icon icon-floppy" href="" title="Save"></a>
