fix(forms): re-enable form provider functions for easier migration (#9972)
This commit is contained in:
		
							parent
							
								
									4ec2a30942
								
							
						
					
					
						commit
						e68252a79b
					
				| @ -6,12 +6,14 @@ | |||||||
|  * found in the LICENSE file at https://angular.io/license
 |  * found in the LICENSE file at https://angular.io/license
 | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
| import {AppModule, Type} from '@angular/core'; | import {AppModule, PLATFORM_DIRECTIVES, Type} from '@angular/core'; | ||||||
|  | 
 | ||||||
| import {FORM_DIRECTIVES, REACTIVE_FORM_DIRECTIVES} from './directives'; | import {FORM_DIRECTIVES, REACTIVE_FORM_DIRECTIVES} from './directives'; | ||||||
| import {RadioControlRegistry} from './directives/radio_control_value_accessor'; | import {RadioControlRegistry} from './directives/radio_control_value_accessor'; | ||||||
| import {FormBuilder} from './form_builder'; | import {FormBuilder} from './form_builder'; | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | 
 | ||||||
| /** | /** | ||||||
|  * Shorthand set of providers used for building Angular forms. |  * Shorthand set of providers used for building Angular forms. | ||||||
|  * @experimental |  * @experimental | ||||||
| @ -40,3 +42,19 @@ export class FormsModule { | |||||||
| @AppModule({providers: [REACTIVE_FORM_PROVIDERS], directives: REACTIVE_FORM_DIRECTIVES, pipes: []}) | @AppModule({providers: [REACTIVE_FORM_PROVIDERS], directives: REACTIVE_FORM_DIRECTIVES, pipes: []}) | ||||||
| export class ReactiveFormsModule { | export class ReactiveFormsModule { | ||||||
| } | } | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @deprecated | ||||||
|  |  */ | ||||||
|  | export function disableDeprecatedForms(): any[] { | ||||||
|  |   return []; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @deprecated | ||||||
|  |  */ | ||||||
|  | export function provideForms(): any[] { | ||||||
|  |   return [ | ||||||
|  |     {provide: PLATFORM_DIRECTIVES, useValue: FORM_DIRECTIVES, multi: true}, REACTIVE_FORM_PROVIDERS | ||||||
|  |   ]; | ||||||
|  | } | ||||||
							
								
								
									
										6
									
								
								tools/public_api_guard/forms/index.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								tools/public_api_guard/forms/index.d.ts
									
									
									
									
										vendored
									
									
								
							| @ -102,6 +102,9 @@ export declare class DefaultValueAccessor implements ControlValueAccessor { | |||||||
|     writeValue(value: any): void; |     writeValue(value: any): void; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | /** @deprecated */ | ||||||
|  | export declare function disableDeprecatedForms(): any[]; | ||||||
|  | 
 | ||||||
| /** @experimental */ | /** @experimental */ | ||||||
| export interface Form { | export interface Form { | ||||||
|     addControl(dir: NgControl): void; |     addControl(dir: NgControl): void; | ||||||
| @ -370,6 +373,9 @@ export declare class PatternValidator implements Validator { | |||||||
|     }; |     }; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | /** @deprecated */ | ||||||
|  | export declare function provideForms(): any[]; | ||||||
|  | 
 | ||||||
| /** @experimental */ | /** @experimental */ | ||||||
| export declare const REACTIVE_FORM_DIRECTIVES: Type[][]; | export declare const REACTIVE_FORM_DIRECTIVES: Type[][]; | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user