You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 15, 2024. It is now read-only.
Your angular-is bindings for Scala-js looks very promising! I have an implementation question that relates to testing. You opted for using Scala objects for defining controllers and the like, with annotations on vars which a macro then goes ahead and fills in and deals with creating the instances. This however, isn't easily testable directly in Scala. I was wondering why you didn't go with something simpler, like
I actually do agree with your concerns because I hate to use vars myself for the purpose of the DI (as well as the testability issue you mentioned). The reason it was implemented this way is just that the macro based annotation support was introduced only in the recent version, so there was no easy way to implement constructor based DI without it.
I'm inclined to support constructor based DI even if it involves breaking backward compatibility. I'll see if it's feasible to implement it in the next release. But as I'm quite occupied with other projects now, I'm afraid I can't make any promise yet.
Yes, and I think he's heading toward the right direction. I haven't seen the code yet, but I suppose I should compare our code base later and see if I could get some ideas.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Howdy,
Your angular-is bindings for Scala-js looks very promising! I have an implementation question that relates to testing. You opted for using Scala
object
s for defining controllers and the like, with annotations onvar
s which a macro then goes ahead and fills in and deals with creating the instances. This however, isn't easily testable directly in Scala. I was wondering why you didn't go with something simpler, liketo declare new controllers. This would allow mocking all the traits and creating unit tests directly by instantiating instances in Scala.
I'm sure there is a reason you did it how you did it, so I was hoping you could elaborate. It would be nice to create unit tests!
The text was updated successfully, but these errors were encountered: