Guest User

Untitled

a guest
Dec 15th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. <div class="container.fluid">
  2. <h2>Question Form</h2>
  3. <form [formGroup]="registrationForm">
  4. <div class="form-group">
  5. <label>Username</label>
  6. <input formControlName="userName" type="text" class="form-control">
  7. </div>
  8.  
  9. <div class="form-group">
  10. <label>Password</label>
  11. <input formControlName="password" type="password" class="form-control">
  12. </div>
  13.  
  14. <div class="form-group">
  15. <label>Confirm Password</label>
  16. <input formControlName="confirmPassword" type="password" class="form-control">
  17. </div>
  18.  
  19. <button class="btn btn-primary" type="submit">Register</button>
  20. </form>
  21. {{registrationForm.value | json}}
  22.  
  23. import { Component } from '@angular/core';
  24. import { FormGroup, FormControl } from '@angular/forms';
  25.  
  26. @Component({
  27. selector: 'app-root',
  28. templateUrl: './app.component.html',
  29. styleUrls: ['./app.component.css']
  30. })
  31. export class AppComponent {
  32. registrationForm = new FormGroup({
  33. userName: new FormControl('Vishwas'),
  34. password: new FormControl(''),
  35. confirmPassword: new FormControl('')
  36. });
  37. }
  38.  
  39. import { BrowserModule } from '@angular/platform-browser';
  40. import { NgModule } from '@angular/core';
  41. import { ReactiveFormsModule } from '@angular/forms';
  42. import { AppComponent } from './app.component';
  43.  
  44. @NgModule({
  45. declarations: [
  46. AppComponent
  47. ],
  48. imports: [
  49. BrowserModule,
  50. ReactiveFormsModule
  51. ],
  52. providers: [],
  53. bootstrap: [AppComponent]
  54. })
  55. export class AppModule { }
Add Comment
Please, Sign In to add comment