- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-28-2020 12:47 PM
We're trying to use a template within a widget for the service portal and even the simplest example is not working, so there must be a step I'm missing.
From examples in the system with OOTB widgets they use this to pull in the template
<div ng-include="template_id"></div>
When doing the same thing for a simple example below, the template doesn't load. What's the proper method to pull in a ng-template?
HTML Template
<div>
<h1>This is a widget</h1>
<div ng-include="test"></div>
</div>
Client Script
function() {
/* widget controller */
var c = this;
}
Server Script
(function() {
/* populate the 'data' object */
/* e.g., data.table = $sp.getValue('table'); */
})();
Angular ng-template: test
<strong>Hello world!</strong>
HTML Output
<div>
<h1>This is a widget</h1>
<!-- ngInclude: test -->
</div>
Output screenshot
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-28-2020 06:36 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-28-2020 05:03 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-28-2020 05:36 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-28-2020 05:43 PM
Ok then try to call the template like so:
<div ng-include="test.html"></div>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-28-2020 06:05 PM
I've tried naming it test and importing with test.html and test. I've also named it test.html and imported with test and test.html.
So far no luck.
I've attached the update set if it's of interest