 
     return {link:link}
 
-module.directive("tgMemberships", ["$tgTemplate", MembershipsDirective])
+module.directive("tgMemberships", ["$tgTemplate", "$compile", MembershipsDirective])
 
 
 #############################################################################

## Member Avatar Directive
#############################################################################

MembershipsDirective = ($template) ->
    template = $template.get("admin/admin-membership-paginator.html", true)

    linkPagination = ($scope, $el, $attrs, $ctrl) ->

            $confirm.askOnDelete(title, message).then (finish) ->
                onSuccess = ->
                    finish()

                    if $scope.page > 1 && ($scope.count - 1) <= $scope.paginatedBy
                        $ctrl.selectFilter("page", $scope.page - 1)

                    $ctrl.loadMembers()

                    text = $translate.instant("ADMIN.MEMBERSHIP.SUCCESS_DELETE")
