Open jessleenyc opened 8 years ago
Hi Jess, can you point me to where you're trying to do this?
yes! in my registercontroller--he's a snippet.
register.login = function(data, cb) {
console.log('callback function', data);
$http
.post('/login', data)
.then(function(response) {
//after a user registers, they are immediately signed in. However, i want the index ejs to reflect the change--registration from should be removed and login should be replaced with logout. it will only render if i refresh
})
}
make sure you put your code blocks on separate lines!
Have you tried to assign the data to a model or change some state in your controller. like "register.isLoggedIn = true" and then evaluate on that?
Hi Phil,
I feel like I'm missing a big piece of this puzzle---I have an angular http request grabbing information but after I grab it, I want the information to render or be removed from the same page. I can't get it to work with jquery and I've tried doing a get request to another route by using (.then). Neither have worked.
Any hints would be great--like what exactly to google. I also tried $window.location.href="/". Thanks!