Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <tr
- *ngIf="existChildBedInRoom"
- class="form-group"
- [ngClass]="{'has-error': countOfChildBedInput.invalid && countOfChildBedInput.touched}">
- </tr>
- <tr *ngIf="existChildBedInRoom">
- <td><label class="control-label" for="countOfChildBedInput">Count bed</label></td>
- <td>
- <input
- type="number"
- name="countOfChildBedInput"
- id="countOfChildBedInput"
- placeholder="Enter number"
- class="form-control"
- required
- ngModel
- #countOfChildBedInput="ngModel"
- >
- </td>
- </tr>
- <tr
- *ngIf="countOfChildBedInput.invalid && countOfChildBedInput.touched"
- class="text-center form-help-text"
- ><td colspan="3" style="background: #c40000; color: white">Not emty!</td>
- </tr>
- export class RoomInformationCardComponent implements OnInit {
- existChildBedInRoom: boolean;
- @ViewChild('childBedInRoom') childBedInRoom: ElementRef;
- constructor() { }
- ngOnInit() {
- this.existChildBedInRoom = false;
- }
- }
- ERROR TypeError: Cannot read property 'invalid' of undefined
- at Object.eval [as updateDirectives] (RoomInformationCardComponent.html:92)
- at Object.debugUpdateDirectives [as updateDirectives] (core.es5.js:13067)
- at checkAndUpdateView (core.es5.js:12251)
- at callViewAction (core.es5.js:12599)
- at execComponentViewsAction (core.es5.js:12531)
- at checkAndUpdateView (core.es5.js:12257)
- at callViewAction (core.es5.js:12599)
- at execComponentViewsAction (core.es5.js:12531)
- at checkAndUpdateView (core.es5.js:12257)
- at callViewAction (core.es5.js:12599)
Add Comment
Please, Sign In to add comment