 
     return {link:link}
 
-module.directive("tgInvitation", ["$tgAuth", "$tgConfirm", "$tgLocation", "$routeParams",
+module.directive("tgInvitation", ["$tgAuth", "$tgConfirm", "$tgLocation", "$tgConfig", "$routeParams",
                                   "$tgNavUrls", "$tgAnalytics", "$translate", "$tgConfig", InvitationDirective])
 
 

## Invitation
#############################################################################

InvitationDirective = ($auth, $confirm, $location, $params, $navUrls, $analytics, $translate, config) ->
    link = ($scope, $el, $attrs) ->
        token = $params.token


            if not loginForm.validate()
                return

            loginFormType = $config.get("loginFormType", "normal")
            data = $scope.dataLogin

            promise = $auth.login({
                username: data.username,
                password: data.password,
                invitation_token: data.token
            }, loginFormType)
            promise.then(onSuccessSubmitLogin, onErrorSubmitLogin)

        $el.on "submit", "form.login-form", submitLogin
