Update the license headers throughout the repository to reference Google LLC rather than Google Inc, for the required license headers. PR Close #37205
		
			
				
	
	
		
			40 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			40 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| /**
 | |
|  * @license
 | |
|  * Copyright Google LLC 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
 | |
|  */
 | |
| 
 | |
| import {ANALYZE_FOR_ENTRY_COMPONENTS, Component, ComponentFactoryResolver, Inject, InjectionToken} from '@angular/core';
 | |
| 
 | |
| import {BasicComp} from './basic';
 | |
| 
 | |
| @Component({
 | |
|   selector: 'cmp-entryComponents',
 | |
|   template: '<p i18n>Welcome</p>',
 | |
|   entryComponents: [BasicComp]
 | |
| })
 | |
| export class CompWithEntryComponents {
 | |
|   constructor(public cfr: ComponentFactoryResolver) {}
 | |
| }
 | |
| 
 | |
| export const SOME_TOKEN = new InjectionToken('someToken');
 | |
| 
 | |
| export function provideValueWithEntryComponents(value: any) {
 | |
|   return [
 | |
|     {provide: SOME_TOKEN, useValue: value},
 | |
|     {provide: ANALYZE_FOR_ENTRY_COMPONENTS, useValue: value, multi: true},
 | |
|   ];
 | |
| }
 | |
| 
 | |
| @Component({
 | |
|   selector: 'comp-entryComponents-provider',
 | |
|   template: '',
 | |
|   providers: [provideValueWithEntryComponents([{a: 'b', component: BasicComp}])]
 | |
| })
 | |
| export class CompWithAnalyzeEntryComponentsProvider {
 | |
|   constructor(public cfr: ComponentFactoryResolver, @Inject(SOME_TOKEN) public providedValue: any) {
 | |
|   }
 | |
| }
 |