How to enable Angular Routing in a Netlify deployment with the Angular CLI

I’ll keep it snappy :).

  1. Open .angular.cli.json
  2. Under assets, add _redirects. This lets the resultant dist folder from a build include your soon-to-be _redirects file.

3. In the src folder, add _redirects with the following line. Netlify uses this to redirect to index no matter what, allowing angular routing to take over.

4. Deploy! You’re done!

Like what you read? Give Morgan Davies a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.