FormControl
This commit is contained in:
		
							parent
							
								
									d58070c5ba
								
							
						
					
					
						commit
						f8b7acd5c6
					
				| @ -3,6 +3,7 @@ import { CommonModule } from '@angular/common'; | |||||||
| import { LoginComponent } from './login/login.component'; | import { LoginComponent } from './login/login.component'; | ||||||
| import { RegisterComponent } from './register/register.component'; | import { RegisterComponent } from './register/register.component'; | ||||||
| import { AccountRoutingModule } from './account-routing.module'; | import { AccountRoutingModule } from './account-routing.module'; | ||||||
|  | import { SharedModule } from '../shared/shared.module'; | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| @ -13,7 +14,8 @@ import { AccountRoutingModule } from './account-routing.module'; | |||||||
|   ], |   ], | ||||||
|   imports: [ |   imports: [ | ||||||
|     CommonModule, |     CommonModule, | ||||||
|     AccountRoutingModule |     AccountRoutingModule, | ||||||
|  |     SharedModule | ||||||
|   ] |   ] | ||||||
| }) | }) | ||||||
| export class AccountModule { } | export class AccountModule { } | ||||||
|  | |||||||
| @ -1,4 +1,5 @@ | |||||||
| import { Component, OnInit } from '@angular/core'; | import { Component, OnInit } from '@angular/core'; | ||||||
|  | import { FormControl, FormGroup, Validators } from '@angular/forms'; | ||||||
| 
 | 
 | ||||||
| @Component({ | @Component({ | ||||||
|   selector: 'app-login', |   selector: 'app-login', | ||||||
| @ -6,10 +7,19 @@ import { Component, OnInit } from '@angular/core'; | |||||||
|   styleUrls: ['./login.component.scss'] |   styleUrls: ['./login.component.scss'] | ||||||
| }) | }) | ||||||
| export class LoginComponent implements OnInit { | export class LoginComponent implements OnInit { | ||||||
|  | loginForm: FormGroup; | ||||||
|  | 
 | ||||||
| 
 | 
 | ||||||
|   constructor() { } |   constructor() { } | ||||||
| 
 | 
 | ||||||
|   ngOnInit(): void { |   ngOnInit(): void { | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  |   createLoginForm(){ | ||||||
|  |     this.loginForm = new FormGroup({ | ||||||
|  |       email: new FormControl('', Validators.required), | ||||||
|  |       password: new FormControl('', Validators.required) | ||||||
|  |     }); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
| } | } | ||||||
|  | |||||||
| @ -1,5 +1,6 @@ | |||||||
| import { NgModule } from '@angular/core'; | import { NgModule } from '@angular/core'; | ||||||
| import { CommonModule } from '@angular/common'; | import { CommonModule } from '@angular/common'; | ||||||
|  | import { ReactiveFormsModule } from '@angular/forms'; | ||||||
| import { PaginationModule } from 'ngx-bootstrap/pagination'; | import { PaginationModule } from 'ngx-bootstrap/pagination'; | ||||||
| import { CarouselModule } from 'ngx-bootstrap/carousel'; | import { CarouselModule } from 'ngx-bootstrap/carousel'; | ||||||
| import { PagingHeaderComponent } from './components/paging-header/paging-header.component'; | import { PagingHeaderComponent } from './components/paging-header/paging-header.component'; | ||||||
| @ -17,14 +18,16 @@ import { OrderTotalsComponent } from './components/order-totals/order-totals.com | |||||||
|   imports: [ |   imports: [ | ||||||
|     CommonModule, |     CommonModule, | ||||||
|     PaginationModule.forRoot(), |     PaginationModule.forRoot(), | ||||||
|     CarouselModule.forRoot() |     CarouselModule.forRoot(), | ||||||
|  |     ReactiveFormsModule | ||||||
|   ], |   ], | ||||||
|   exports: [ |   exports: [ | ||||||
|     PaginationModule, |     PaginationModule, | ||||||
|     PagingHeaderComponent, |     PagingHeaderComponent, | ||||||
|     PagerComponent, |     PagerComponent, | ||||||
|     CarouselModule, |     CarouselModule, | ||||||
|     OrderTotalsComponent |     OrderTotalsComponent, | ||||||
|  |     ReactiveFormsModule | ||||||
|   ] |   ] | ||||||
| }) | }) | ||||||
| export class SharedModule { } | export class SharedModule { } | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user