I have a view loaded by inline text/ng-template , which is not in ng-include later in the file. The script block is at the very top of the file:
<script type="text/ng-template" id="stringCondition"> </script>
What I upload later in the file:
<ng-include src="'stringCondition'"></ng-include>
But produces a 404 error in the console:
GET http://localhost/~me/stringCondition 404 (Not Found)
I tried several options for naming (e.g. having .html at the end) and using ng-include as an attribute instead of a high level element. All without luck.
What can lead to the fact that the built-in ng-template will not be registered with ng-include in the same file of the form?
UPDATE:
As comments and answers point out, the basic design of my code is correct. But something causes ng-template (apparently) the inability to make the template available to the system.
I updated my code to extract from an HTML file (instead of an inline template) and it works great.
Is there a general situation that I could work with that breaks ng-template ?
source share