 taiga = @.taiga
 
 class BacklogController extends taiga.TaigaController
-    constructor: (@scope, @repo, @params, @rs, @q) ->
+    constructor: (@scope, @repo, @confirm, @rs, @params, @q) ->
         promise = @.loadInitialData()
-
-        # Obviously fail condition
         promise.then null, =>
             console.log "FAIL"
 

        element.on "click", ".sprint-summary > a", (event) ->
            element.find(".sprint-table").toggle()

    return {
        link: link
    }


module = angular.module("taigaBacklog", [])
module.directive("tgBacklog", ["$compile", "$templateCache", BacklogDirective])
module.directive("tgSprint", ["$compile", SprintDirective])


        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) ->
