Save Angular View as HTML file

4,152 views
Skip to first unread message

Harlley Oliveira

unread,
Apr 24, 2012, 2:24:05 PM4/24/12
to ang...@googlegroups.com
Hi, 

Is it possible to save a HTML DOM rendered by Angular to a local HTML file? 

Harlley Oliveira

John Lindquist

unread,
Apr 24, 2012, 2:32:52 PM4/24/12
to ang...@googlegroups.com
The firefox "Web Developer" tools have a "View Source->View Generated Source" dropdown that seems to work well.

I don't know if there's a Chrome equivalent.


Harlley Oliveira

--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To view this discussion on the web visit https://groups.google.com/d/msg/angular/-/vfE2cfMgGb8J.
To post to this group, send email to ang...@googlegroups.com.
To unsubscribe from this group, send email to angular+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/angular?hl=en.

Nikolaos Dimopoulos

unread,
Apr 24, 2012, 2:34:38 PM4/24/12
to ang...@googlegroups.com
The extension is also available in Chrome. You can find that option under the Tools menu.

Harlley Oliveira

unread,
Apr 24, 2012, 2:47:03 PM4/24/12
to ang...@googlegroups.com
Thanks. Would it be possible to generate this file on the server? My question is because the code generate by Angular is not crawlable.


Em terça-feira, 24 de abril de 2012 15h32min52s UTC-3, John Lindquist escreveu:
The firefox "Web Developer" tools have a "View Source->View Generated Source" dropdown that seems to work well.

I don't know if there's a Chrome equivalent.

On Tue, Apr 24, 2012 at 12:24 PM, Harlley Oliveira <har...@gmail.com> wrote:
Hi, 

Is it possible to save a HTML DOM rendered by Angular to a local HTML file? 

Harlley Oliveira

--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To view this discussion on the web visit https://groups.google.com/d/msg/angular/-/vfE2cfMgGb8J.
To post to this group, send email to ang...@googlegroups.com.
To unsubscribe from this group, send email to angular+unsubscribe@googlegroups.com.

Johan

unread,
Apr 24, 2012, 10:21:31 PM4/24/12
to ang...@googlegroups.com

Misko Hevery

unread,
Apr 25, 2012, 12:50:54 AM4/25/12
to ang...@googlegroups.com
We have not done this, but if you feel up to it here is what you can try

  1. get node.js running
  2. install of the many DOM implementations for node
  3. Get your angular page running inside the node.js.
  4. Get a hold of the $browser service and call notifyWhenNoOutstandingRequests() this will tell you when the page finished rendering
  5. Do document.html() to get rendered HTML
  6. send it to the crawler 

This is a lot more complicated then it seems, and I am sure you will run into many issues, but it should work in theory. :-)

Good luck, and do report back. 

-- Misko


--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To view this discussion on the web visit https://groups.google.com/d/msg/angular/-/8P2Jy1dBHQMJ.

To post to this group, send email to ang...@googlegroups.com.
To unsubscribe from this group, send email to angular+u...@googlegroups.com.

Stas Berkov

unread,
Mar 24, 2014, 1:48:30 PM3/24/14
to ang...@googlegroups.com, mi...@hevery.com
And how to save computed CSS styles? document.html() will give you just html, computed CSS styles will be lost.

Anand Rai

unread,
Oct 22, 2015, 11:36:56 AM10/22/15
to AngularJS
In Chrome try 'Save Page As' option and save it in .html format.
Reply all
Reply to author
Forward
0 new messages