nginx error with Angular routing

404 Not Found

nginx/1.14.0 (Ubuntu)

Solution:

/etc/nginx/sites-available/yoursite

#change this line:
try_files $uri $uri/ =404;
#to this:
try_files $uri $uri/ /index.html;
#then restart nginx
sudo systemctl restart nginx

Angular setup

ng new projectname
cd projectname
sudo npm install --save @angular/material @angular/cdk @angular/animations
npm install hammerjs
ng generate component componentname
ng generate service servicename