-
Notifications
You must be signed in to change notification settings - Fork 42
Conversation
…ul to add the ScopeOps trait to the test suite to be able to dynamically add stuff to the scope.
… modules to respect for the injector).
… modules to respect for the injector).
For example load a template from a file relative to the current source file: {{{ val templateUrl = Template.relativeTemplate("./my-template.html") }}} If the following code is placed in `MyDirective.scala` the content of `MyDirective.html` from the same source directory will be embedded: {{{ val templateUrl = Template.companionTemplate }}}
(cherry picked from commit 930118e)
I really like this enhancement, and I think it looks cleaner than the one I'm using currently in my project (#42, btw I'm also using ScalaTest now). Just a minor request though: do you mind change the name of the variable from I know it's just a matter of personal preference, but I tend to avoid using abbreviated names in variables when it's not too long. :) And maybe it'd be better if we add Anyway it looks great, and I'll probably migrate my own project using the new API as soon as it is merged. I wish I could spend sometime in writing unit tests for this project, as it seems now we have all the tools needed in place finally. |
Thanks for your suggestions. I've adjusted the code according to them. |
Just merged it and published a new snapshot. Can't wait to try it out myself. Thanks :) |
The ScalaDoc of
AngularTestEnvironment
contains a description and a short example of how to write a unit test for an Angular directive using ScalaTest 3.