typescript-signals
typescript-signals copied to clipboard
Parameter cannot have a question mark and initializer
Hi. Not sure if you are still maintaining this...
This may be a change in the TypeScript specification since the time you last pushed, but in its current form it gives the error:
"Parameter cannot have a question mark and initializer "
In several situations like this:
public has(listener, context?: any = null): bool
It's happy if you remove the question mark though. :)
http://stackoverflow.com/questions/17186566/how-do-i-fix-error-ts1015-parameter-cannot-have-question-mark-and-initializer
「So to fix the compiler error you can simply remove the '?' and leave the default value and it will remain as an optional parameter as you intend.」