问题
I have web app, whenever i am view the page source using browser view page source i am only able to see the index.html contents in page source where as i am able to see the all the html code in inspect element but not in page source. Does any one how to view the page source ??
Below is the server.ts
回答1:
It is only possible with Angular Universal (server side rendering). Every javascript files renders in browser, to see page source you have to setup Angular 2
to render on server side. It's also useful for SEO optimization.
On this site you have guide how to setup it.
For Angular 5
you have to visit this page, for more informations.
For example working on NodeJS
visit this page
来源:https://stackoverflow.com/questions/48948082/how-to-view-the-page-source-for-angular-2-app