Hi everybody,
I have a relatively simple question and I remember I was learning it before, but I already forgot [BTW, I could not find typescript here anywhere or just Angular (not AngularJS) to ask my question].
Anyway, here is a simple question: how do I define a typescript interface with, say, status property that only allows 2 values ("active" and "inactive"). I can, of course, simply define this property as a string, but I want to also somehow add that this string can only take few values.
I tried to search for an answer, I found ways to declare enum in typescript, but I don't see how should I implement it as a property.
Hope it's a simple question and I hope I'll get an answer.
Thanks in advance.
If it's not broken, fix it until it is.
My Blog