hwz / chirp

A teaching example of the MEAN stack, by building a simple Twitter clone
317 stars 484 forks source link

Angular not working in Module 5 #30

Open kaym0 opened 8 years ago

gauravb8 commented 7 years ago

Hi,

I ran into this issue too. Actually, the angular is working just fine. When you open the homepage(localhost:3000/#/), you aren't seeing any posts because there are none in the database. In order to create posts you have to register as a new user first.

Now here lies the problem. The register link doesn't work and you can't login either without signing up first. This issue can be resolved by editing an incorrect reference in the HTML for the homepage(index.html).In line 17, where the page to be redirected to when the Register link is clicked is specified, it points to a page called signup which doesn't exist. The code for the signup page is instead present in register.html.

So, simply replace #/signup by #/register. This will allow you to create a new user in the database and create tweets(or cheeps). Once created and stored in the database, these posts will be shown on the homepage even when you're not logged in.

Hope this helps.

Thanks

adaymuhajier commented 7 years ago

hmmm, @gauravb8 still doesn't seem to work, nothing happens when i click login or register. when i click register, it redirects me to http://localhost:3000/#!/#%2Fregister weird