| 
									
										
										
										
											2016-03-16 18:01:33 +02:00
										 |  |  | (function(app) { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-12-06 19:43:50 -08:00
										 |  |  |   var old = app.HeroComponent; | 
					
						
							| 
									
										
										
										
											2016-11-13 14:09:28 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-12-06 19:43:50 -08:00
										 |  |  |   // #docregion
 | 
					
						
							|  |  |  |   app.HeroComponent = HeroComponent; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   HeroComponent.annotations = [ | 
					
						
							|  |  |  |     new ng.core.Component({ | 
					
						
							|  |  |  |       selector: 'hero-di-inject', | 
					
						
							|  |  |  |       template: '<h1>Hero: {{name}}</h1>' | 
					
						
							|  |  |  |     }) | 
					
						
							|  |  |  |   ]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   HeroComponent.parameters = [ 'heroName' ]; | 
					
						
							| 
									
										
										
										
											2016-11-13 14:09:28 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-12-06 19:43:50 -08:00
										 |  |  |   function HeroComponent(name) { | 
					
						
							|  |  |  |     this.name = name; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  |   // #enddocregion
 | 
					
						
							| 
									
										
										
										
											2016-11-13 14:09:28 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-12-06 19:43:50 -08:00
										 |  |  |   app.HeroDIInjectComponent = app.HeroComponent; | 
					
						
							|  |  |  |   app.HeroComponent = old; | 
					
						
							| 
									
										
										
										
											2016-10-13 17:59:00 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-03-16 18:01:33 +02:00
										 |  |  | })(window.app = window.app || {}); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-11-13 14:09:28 -08:00
										 |  |  | /////// DSL version ////////
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-03-16 18:01:33 +02:00
										 |  |  | (function(app) { | 
					
						
							| 
									
										
										
										
											2016-11-13 14:09:28 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-12-06 19:43:50 -08:00
										 |  |  |   var old = app.HeroComponent; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // #docregion dsl
 | 
					
						
							|  |  |  |   app.HeroComponent = ng.core.Component({ | 
					
						
							|  |  |  |     selector: 'hero-di-inject-dsl', | 
					
						
							|  |  |  |     template: '<h1>Hero: {{name}}</h1>' | 
					
						
							|  |  |  |   }) | 
					
						
							|  |  |  |   .Class({ | 
					
						
							|  |  |  |     constructor: [ | 
					
						
							|  |  |  |       new ng.core.Inject('heroName'), | 
					
						
							|  |  |  |       function HeroComponent(name) { | 
					
						
							|  |  |  |         this.name = name; | 
					
						
							|  |  |  |       } | 
					
						
							|  |  |  |     ] | 
					
						
							|  |  |  |   }); | 
					
						
							|  |  |  |   // #enddocregion dsl
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   app.HeroDIInjectDslComponent = app.HeroComponent; | 
					
						
							|  |  |  |   app.HeroComponent = old; | 
					
						
							| 
									
										
										
										
											2016-03-16 18:01:33 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | })(window.app = window.app || {}); |