     return {link:link, require:"ngModel"}
 
 module.directive("tgMarkitup", ["$rootScope", "$tgResources", "$selectedText", "$tgTemplate", "$compile",
-                                "$translate", MarkitupDirective])
+                                "$translate", "tgProjectService", MarkitupDirective])

            markdownDomNode = element.parents(".markdown")
            markItUpDomNode = element.parents(".markItUp")

            $rs.mdrender.render($scope.projectId || $scope.vm.projectId, $model.$modelValue).then (data) ->
                html = previewTemplate({data: data.data})
                html = $compile(html)($scope)


                        search: (term, callback) ->
                            term = taiga.slugify(term)

                            $rs.search.do($scope.project.id, term).then (res) =>
                                if res.count < 1
                                    callback([])

