|
|
|
|
|
by uk_programmer
2295 days ago
|
|
Sorry to be pedantic but that isn't quite right. I do use the same technique myself quite a lot with the options pattern. However it is worth keeping the following in mind. The compiler will check that in your code that these properties are present and assigned correctly. However at runtime nothing is guaranteed especially when dealing with the DOM. One of the things that I don't like about TypeScript (I have written a fair bit of it) is that you believe you have type safety when it is really type hinting. |
|