The given below code ng-if is not working as expected if displayGroup value is D then it will print the first and Second block, did I made any mistake Answer If you want to check bookTravelInfo.displayGroup is either ‘A’ or ‘B’ or ‘C’, Use || Logical OR operator from your *ngIf will never return false. As the boolean result returned
Tag: angular-directive
How can I generate FormControls dynamically inside a FormGroup?
I am receiving an object from the db that contains a few elements with the following format: To work with those “dias” array and include inputs to modify each value in case the user wants to, I’ve manually created a FormGroup containing a formControl for each of those days (the real object contains up to 8 days). And then, in
Angular why asterisk (*)
In Angular document, * and template, we know that the *ngIf, *ngSwitch, *ngFor can be expanded to ng-template tag. My question is: I think the ngIf or ngFor without * can also be translated and expanded to template tag by Angular engine. The following code would be the same as So why bother designing a strange symbol asterisk(*) in Angular?