Open Petteroe opened 9 years ago
I found the issue. The parseConstructor method doesn't account for these auto-property modifiers, so when it builds the reference arrays, it always assume that each dependency has 2 tokens (name and type), when it is perfectly legal in typescript to have 3 tokens. TSNG should respect this feature of TypeScript and make sure to handle the public and private modifiers on constructor arguments properly.
I get an error when using tsng to compile one of my controllers after adding a dependency on the $state service from UI-Router:
Here is my controller:
Please note that the controller worked fine before I added the $state dependency. The $stateParams service is also part of UI-Router, and that is resolved correctly.
I am very new to using the tsng compiler so any help in resolving this would be greatly appreciated.
EDIT: The description above is slightly inaccurate. There was one more change I did: I added private modifiers on all the constructor parameters, and it turned out that that was the problem.