I am to modify the following code which consists of an interface Cat that contains multiple strings, Arrays, and numbers, all of which are of various types. Here is my definition of Cat` in the ts file
export interface Cat {
photos: string[];
cost: number;
breed: Breed;
description: string;
location: Location[];
adoptionAgency: Agency;
kittens: Kitten[];
}
What I am concerned with is the breed element (which stores an enum) in the Kitten array, which is defined as such
export interface Kitten {
breed: KittenBreed;
age: number;
name: string;
description: string;
}
and here is the definition of the KittenBreed, which is an enum:
export enum KittenBreed {
Persian,
Siamese,
Calico,
Ragdoll,
Shorthair
}
I want to be able to output info on a cat ONLY if the KittenBreed is Persian, Siamese, or Shorthair. I know I should use ngIf, but I'm not sure I'm using it correctly, nor am I sure if I'm even referencing the KittenBreed enum correctly.
<div *ngIf="{{cat.kitten.breed.KittenBreed}} == "Persian" || {{cat.kitten.breed.KittenBreed}} == "Siamese" || ""cat.kitten.breed.KittenBreed}} == "Shorthair" ">
<p>success!</p>
</div>
Please let me know if any more information is needed. Thank you.