 
     loadHistory: =>
         return @rs.issues.history(@scope.issueId).then (history) =>
-            _.each history, (historyResult) ->
-                #If description was modified take only the description_html field
+            for historyResult in history
+                # If description was modified take only the description_html field
                 if historyResult.values_diff.description?
                     historyResult.values_diff.description = historyResult.values_diff.description_diff
 


        promise = @.loadInitialData()

        promise.then () =>
            @appTitle.set(@scope.issue.subject + " - " + @scope.project.name)

        promise.then null, ->
            console.log "FAIL" #TODO

        @scope.$on "attachment:create", @loadHistory
        @scope.$on "attachment:edit", @loadHistory
        @scope.$on "attachment:delete", @loadHistory

    loadProject: ->
        return @rs.projects.get(@scope.projectId).then (project) =>

            @scope.issueId = data.issue
            return data

        return promise.then(=> @.loadProject())
                      .then(=> @q.all([@.loadUsersAndRoles(),
                                       @.loadIssue(),
                                       @.loadAttachments(@scope.issueId),
                                       @.loadHistory()]))

    block: ->
        @rootscope.$broadcast("block", @scope.issue)
