Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sitemap.xml in Angular SPA

Tags:

We have built a simple page app in angular, which is a loan application wizard. So every user must start at page 1, enter some info to get to page 2 etc. There is no possibility to enter other pages without submitting data from the fist one.

I am quite new to SEO and my question is what an optimal sitemap file should look like. I think it must contain just first page url and ignore the rest because when crawler tries to access other pages the app returns first page too (this is handled in $stateChangeStart - app checks user data on BE and redirects him to appropriate page)

like image 587
Gatekeeper Avatar asked Jun 08 '16 10:06

Gatekeeper


1 Answers

In src folder paste you sitemap.xml file then go to angular.json file just add sitemap in assets.

It's work for me

 "assets": [
     "src/favicon.ico",
     "src/assets",
     "src/sitemap.xml",
  ],
like image 86
M Danial Avatar answered Sep 28 '22 02:09

M Danial