I have function which is gets template for my component. Here it is:
/**
* Return template from template's cache
*
* @param url_path - way to needed template
*/
export function getTemplate(url_path)
{
if (window['app_templates'][url_path]){
return window['app_templates'][url_path];
}else{
console.error('Failed to load template by path ' + url_path);
return "";
}
}
And in component I use this function:
import { getTemplate } from "../../services/helpertools";
@Component({
template: getTemplate('pages/tabs/tabs')
})
But occurs a error:
Error: Error encountered resolving symbol values statically. Calling
function 'getTemplate', function calls
are not supported. Consider replacing the function or lambda with a
reference to an exported function,
resolving symbol TabsPage in
D:/denwerready/-readyscript/modules/mobilesiteapp/appsource/src/page
s/tabs/tabspage.ts, resolving symbol
TabsPage in D:/denwerready/-readyscript/modules/mobilesiteapp/appsou
rce/src/pages/tabs/tabspage.ts
Error: Error encountered resolving symbol values statically. Calling function 'g
etTemplate', function calls are not supported. Consider replacing the function o
r lambda with a reference to an exported function, resolving symbol TabsPage in
How to solve it?