| 
									
										
										
										
											2017-02-14 16:14:40 -08:00
										 |  |  | /** | 
					
						
							|  |  |  |  * @license | 
					
						
							|  |  |  |  * Copyright Google Inc. All Rights Reserved. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Use of this source code is governed by an MIT-style license that can be | 
					
						
							|  |  |  |  * found in the LICENSE file at https://angular.io/license
 | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-08-08 02:17:40 -07:00
										 |  |  | import {Inject, Injectable} from '@angular/core'; | 
					
						
							| 
									
										
										
										
											2017-02-17 12:55:55 -08:00
										 |  |  | import {DOCUMENT, ɵgetDOM as getDOM} from '@angular/platform-browser'; | 
					
						
							| 
									
										
										
										
											2017-02-14 16:14:40 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-08-08 02:17:40 -07:00
										 |  |  | import {serializeDocument} from './domino_adapter'; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-14 16:14:40 -08:00
										 |  |  | /** | 
					
						
							|  |  |  |  * Representation of the current platform state. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * @experimental | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | @Injectable() | 
					
						
							|  |  |  | export class PlatformState { | 
					
						
							|  |  |  |   constructor(@Inject(DOCUMENT) private _doc: any) {} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   /** | 
					
						
							|  |  |  |    * Renders the current state of the platform to string. | 
					
						
							|  |  |  |    */ | 
					
						
							| 
									
										
										
										
											2017-08-08 02:17:40 -07:00
										 |  |  |   renderToString(): string { return serializeDocument(this._doc); } | 
					
						
							| 
									
										
										
										
											2017-02-14 16:14:40 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  |   /** | 
					
						
							|  |  |  |    * Returns the current DOM state. | 
					
						
							|  |  |  |    */ | 
					
						
							|  |  |  |   getDocument(): any { return this._doc; } | 
					
						
							| 
									
										
										
										
											2017-02-17 12:55:55 -08:00
										 |  |  | } |