Created
September 1, 2015 00:43
-
-
Save matthewrwilton/e43ab8e9c1833982f9ec to your computer and use it in GitHub Desktop.
Demonstrates that an interface with only optional properties will not cause compile errors in TypeScript.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| interface IOptions { | |
| option1?: boolean; | |
| option2?: boolean; | |
| } | |
| interface IParameter { | |
| options: IOptions; | |
| } | |
| var parameter: IParameter = { | |
| options: 1 | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment