Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { NgModule } from '@angular/core';
- import { Routes, RouterModule } from '@angular/router';
- import { FormsModule, ReactiveFormsModule } from '@angular/forms';
- import { RegisterComponent } from "app/modules/register/register.component";
- const routes: Routes = [
- {
- path: '', pathMatch: 'full',
- component: RegisterComponent
- }
- ];
- @NgModule({
- imports: [
- RouterModule.forChild(routes),
- FormsModule,
- ReactiveFormsModule
- ],
- declarations: [RegisterComponent],
- exports: [RouterModule]
- })
- export class RegisterRouter { }
- import { NgModule } from '@angular/core';
- import { CommonModule } from '@angular/common';
- import { RegisterRouter } from './register.router';
- @NgModule({
- imports: [
- CommonModule,
- RegisterRouter
- ],
- declarations: []
- })
- export class RegisterModule { }
- import { Component, OnInit, ViewContainerRef } from '@angular/core';
- import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
- @Component({
- selector: 'app-register',
- templateUrl: './register.component.html',
- styleUrls: ['./register.component.scss']
- })
- export class RegisterComponent implements OnInit {
- //#region Declarations
- UserForm: FormGroup;
- inValid: boolean = false;
- //#endregion
- constructor(
- private _fb: FormBuilder) {
- this.UserForm = _fb.group({
- "_firstname" : ['', Validators.required]
- });
- }
- }
- <input type="text" class="form-control" [ngClass]="{ahinValid: inValid}" id="txtFirst_Name" aria-describedby="ariaFirstName" placeholder="Enter First Name"
- name="_firstname" [formControl]="UserForm.controls['_firstname']">
Add Comment
Please, Sign In to add comment