Created
October 28, 2014 10:42
-
-
Save nrchandan/1ae47b66c5056fe847fd to your computer and use it in GitHub Desktop.
Angular $location issue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$http.post('/campaignauth', payload).success(function(data) { | |
console.log(data); | |
if (data.response.status == 'error') { | |
//display alert to user | |
} else { | |
// $cookieStore.put("AMBC_SSID", data.response.token); | |
// The below code is intentionally set to run after a | |
// small delay due to cookie not being set by the time | |
// the location path changes. Better way to fix this | |
// is to set the cookie manually, as shown above, but | |
// it causes some encoding issues due to which cookie | |
// gets rejected by the server. | |
setTimeout(function() { | |
// $location.path('/campaigns'); | |
window.location.href = "/#/campaigns"; | |
}, 100); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment