         element.on "click", ".sprint-summary > a", (event) ->
             element.find(".sprint-table").toggle()
 
-    return {
-        link: link
-    }
+    return {link: link}
 
 
 module = angular.module("taigaBacklog", [])
 module.directive("tgBacklog", ["$compile", "$templateCache", BacklogDirective])
 module.directive("tgSprint", ["$compile", SprintDirective])
+module.controller("BacklogController", [
+    "$scope",
+    "$tgRepo",
+    "$tgConfirm",
+    "$tgResources",
+    "$routeParams",
+    "$q",
+    BacklogController
+])

taiga = @.taiga

class BacklogController extends taiga.TaigaController
    constructor: (@scope, @repo, @params, @rs, @q) ->
        promise = @.loadInitialData()

        # Obviously fail condition
        promise.then null, =>
            console.log "FAIL"



        return promise

    deleteUserStory: (us) ->
        title = "Delete User Story"
        subtitle = us.subject

        @confirm.ask(title, subtitle).then =>
            console.log "#TODO"


BacklogDirective = ($compile, $templateCache) ->
    link = ($scope, $el, $attrs) ->
        $ctrl = $el.controller()

    return {link: link}


SprintDirective = ($compile, $templateCache) ->
    link = (scope, element, attrs) ->
