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

        return @rs.memberships.list(@scope.projectId, httpFilters).then (data) =>
            @scope.memberships = _.filter(data.models, (membership) ->
                                    membership.user == null or membership.is_user_active)

            @scope.page = data.current
            @scope.count = data.count
            @scope.paginatedBy = data.paginatedBy
