-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[$compile:tpload] Failed to load template #209
Comments
Hello, this shouldn't be any different than testing normal AngularJS components. If you want to test the component template you will need to populate the template cache with the template for that path. Depending on your build system there are several ways you can do that. https://blog.logentries.com/2015/03/template-caching-in-angular-how-to-avoid-the-storm/ |
I have found where the issue was. If my component is using the "templateUrl" instead of "template", the render function returns "undefined" for the "ctrl". I have fixed it by modifying "src/testing/utils.js" file and adding "$scope.$digest();" after the $compile:
|
The component I am testing is using the "templateUrl" to provide a template:
Then I have a corresponding unit test:
When run I am getting the following error:
When I remove templateUrl or replace with template in the component, unit tests run correctly.
The text was updated successfully, but these errors were encountered: