Guest User

Untitled

a guest
Mar 24th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. <tr
  2. *ngIf="existChildBedInRoom"
  3. class="form-group"
  4. [ngClass]="{'has-error': countOfChildBedInput.invalid && countOfChildBedInput.touched}">
  5. </tr>
  6. <tr *ngIf="existChildBedInRoom">
  7. <td><label class="control-label" for="countOfChildBedInput">Count bed</label></td>
  8. <td>
  9. <input
  10. type="number"
  11. name="countOfChildBedInput"
  12. id="countOfChildBedInput"
  13. placeholder="Enter number"
  14. class="form-control"
  15. required
  16. ngModel
  17. #countOfChildBedInput="ngModel"
  18. >
  19. </td>
  20. </tr>
  21. <tr
  22. *ngIf="countOfChildBedInput.invalid && countOfChildBedInput.touched"
  23. class="text-center form-help-text"
  24. ><td colspan="3" style="background: #c40000; color: white">Not emty!</td>
  25. </tr>
  26.  
  27. export class RoomInformationCardComponent implements OnInit {
  28. existChildBedInRoom: boolean;
  29. @ViewChild('childBedInRoom') childBedInRoom: ElementRef;
  30.  
  31. constructor() { }
  32.  
  33. ngOnInit() {
  34. this.existChildBedInRoom = false;
  35. }
  36.  
  37. }
  38.  
  39. ERROR TypeError: Cannot read property 'invalid' of undefined
  40. at Object.eval [as updateDirectives] (RoomInformationCardComponent.html:92)
  41. at Object.debugUpdateDirectives [as updateDirectives] (core.es5.js:13067)
  42. at checkAndUpdateView (core.es5.js:12251)
  43. at callViewAction (core.es5.js:12599)
  44. at execComponentViewsAction (core.es5.js:12531)
  45. at checkAndUpdateView (core.es5.js:12257)
  46. at callViewAction (core.es5.js:12599)
  47. at execComponentViewsAction (core.es5.js:12531)
  48. at checkAndUpdateView (core.es5.js:12257)
  49. at callViewAction (core.es5.js:12599)
Add Comment
Please, Sign In to add comment