AppWideAngularScriptIncludes
Hans Karlsen (talk | contribs) No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
'''Note'''! The use of AppWideAngularScriptIncludes is | '''Note'''! The use of AppWideAngularScriptIncludes is one way of getting scripts to load high up in the page rendering. | ||
Recently we also started to load the scripts dynamically within the EXT_Component by adding a script tag to the DOM, this makes the [[EXT Components|EXT_Component]] more self sufficient and complete. | |||
For example; | |||
if (typeof beenhere === 'undefined') { | if (typeof beenhere === 'undefined') { | ||
beenhere=true; | beenhere=true; | ||
Line 9: | Line 13: | ||
script.src = "<nowiki>https://www.paypal.com/sdk/js?client-id=</nowiki>"+"[ViewModelColumnLabel]"; | script.src = "<nowiki>https://www.paypal.com/sdk/js?client-id=</nowiki>"+"[ViewModelColumnLabel]"; | ||
document.head.appendChild(script); } | document.head.appendChild(script); } | ||
====== AppWideAngularScriptIncludes ====== | ====== AppWideAngularScriptIncludes ====== | ||
Line 18: | Line 21: | ||
Typical content is: | Typical content is: | ||
<script src="/EXT_Scripts/BoardComponentScriptsThatUseDirectivesAndSuch.js"></script> | <script src="/EXT_Scripts/BoardComponentScriptsThatUseDirectivesAndSuch.js"></script> | ||
<script src="/EXT_Scripts/GanttComponentScriptsThatUseDirectivesAndSuch.js"></script> | <script src="/EXT_Scripts/GanttComponentScriptsThatUseDirectivesAndSuch.js"></script> | ||
<script src="/EXT_Scripts/<YourScript>.js"></script> | <script src="/EXT_Scripts/<YourScript>.js"></script> | ||
Check out more information in the video ☛ [[Plugins in Turnkey]] | Check out more information in the video ☛ [[Plugins in Turnkey]] | ||
[[Category:MDriven Turnkey]] | [[Category:MDriven Turnkey]] | ||
[[Category:AngularJS]] | [[Category:AngularJS]] |
Revision as of 14:14, 20 November 2020
Note! The use of AppWideAngularScriptIncludes is one way of getting scripts to load high up in the page rendering.
Recently we also started to load the scripts dynamically within the EXT_Component by adding a script tag to the DOM, this makes the EXT_Component more self sufficient and complete.
For example;
if (typeof beenhere === 'undefined') { beenhere=true; var script = document.createElement('script'); script.onload = function () { scriptloaded=true; console.log('PayPal Script was loaded'); }; script.src = "https://www.paypal.com/sdk/js?client-id="+"[ViewModelColumnLabel]"; document.head.appendChild(script); }
AppWideAngularScriptIncludes
In MDriven Turnkey for AngularJS you can add a file AppWideAngularScriptIncludes.html in EXT_Scripts.
The contents will be included in your app before Angular compile.
Typical content is:
<script src="/EXT_Scripts/BoardComponentScriptsThatUseDirectivesAndSuch.js"></script> <script src="/EXT_Scripts/GanttComponentScriptsThatUseDirectivesAndSuch.js"></script> <script src="/EXT_Scripts/<YourScript>.js"></script>
Check out more information in the video ☛ Plugins in Turnkey
This page was edited more than 9 months ago on 04/15/2024. What links here