How to access functions defined in js file inside the template of Polymer element?
问题 I have created a function in global.function.js file as function getData(flag) { if (flag === 1) { return "one"; } else { return "not one"; } } which then is imported using custom-js-import.html element: <script src="global.function.js"></script> When I tried to access the above function in custom-element.html , I am able to access it in the script part but not in the template part. Is there any way I can access the function inside the HTML element? <!-- custom-element.html --> <link rel=