| 
									
										
										
										
											2015-10-06 06:53:39 -07:00
										 |  |  | import {Compiler, Compiler_, internalCreateProtoView} from 'angular2/src/core/linker/compiler'; | 
					
						
							| 
									
										
										
										
											2015-10-02 07:37:23 -07:00
										 |  |  | import {ProtoViewRef} from 'angular2/src/core/linker/view_ref'; | 
					
						
							|  |  |  | import {ProtoViewFactory} from 'angular2/src/core/linker/proto_view_factory'; | 
					
						
							| 
									
										
										
										
											2015-10-01 10:07:49 -07:00
										 |  |  | import {TemplateCompiler} from './template_compiler'; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | import {Injectable} from 'angular2/src/core/di'; | 
					
						
							| 
									
										
										
										
											2015-11-06 17:34:07 -08:00
										 |  |  | import {Type} from 'angular2/src/facade/lang'; | 
					
						
							|  |  |  | import {Promise, PromiseWrapper} from 'angular2/src/facade/async'; | 
					
						
							| 
									
										
										
										
											2015-10-01 10:07:49 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-10-06 06:53:39 -07:00
										 |  |  | export abstract class RuntimeCompiler extends Compiler {} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-10-01 10:07:49 -07:00
										 |  |  | @Injectable() | 
					
						
							| 
									
										
										
										
											2015-10-08 08:22:11 -07:00
										 |  |  | export class RuntimeCompiler_ extends Compiler_ implements RuntimeCompiler { | 
					
						
							| 
									
										
										
										
											2015-10-01 10:07:49 -07:00
										 |  |  |   constructor(_protoViewFactory: ProtoViewFactory, private _templateCompiler: TemplateCompiler) { | 
					
						
							|  |  |  |     super(_protoViewFactory); | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   compileInHost(componentType: Type): Promise<ProtoViewRef> { | 
					
						
							|  |  |  |     return this._templateCompiler.compileHostComponentRuntime(componentType) | 
					
						
							|  |  |  |         .then(compiledHostTemplate => internalCreateProtoView(this, compiledHostTemplate)); | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   clearCache() { | 
					
						
							|  |  |  |     super.clearCache(); | 
					
						
							|  |  |  |     this._templateCompiler.clearCache(); | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | } |