fix(auth): hacky fix to get around tabset hiding the surrounding

authctrl scope (due to isolate scope)
This commit is contained in:
Tyler Renelle
2015-04-03 15:48:32 -06:00
parent 6b52e00b37
commit 7336d5bc23
2 changed files with 8 additions and 7 deletions

View File

@@ -33,12 +33,12 @@ angular.module('habitrpg')
/*TODO highlight invalid inputs
we have this as a workaround for https://github.com/HabitRPG/habitrpg-mobile/issues/64
*/
if ($scope.registrationForm.$invalid) {
return;
}
var scope = angular.element(document.getElementById('registrationForm')).scope();
if (scope.registrationForm.$invalid) return;
var url = ApiUrl.get() + "/api/v2/register";
if($rootScope.selectedLanguage) url = url + '?lang=' + $rootScope.selectedLanguage.code;
$http.post(url, $scope.registerVals).success(function(data, status, headers, config) {
$http.post(url, scope.registerVals).success(function(data, status, headers, config) {
runAuth(data.id, data.apiToken);
}).error(errorAlert);
};