Skip to content

Instantly share code, notes, and snippets.

@totten totten/1-good.html Secret
Last active Aug 29, 2015

Embed
What would you like to do?
Order of <script> tags
<!--
The Civi-Angular modules require certain data be available. This example is good because the data is loaded
before the modules.
-->
<script type="text/javascript">
var CRM={"config":...};
</script>
...
<script type="text/javascript" src="http://d46.demo.civicrm.org/sites/all/modules/civicrm/bower_components/angular/angular.min.js?nnu1sv"></script>
<script type="text/javascript" src="/civicrm/ajax/angular-modules?format=js&amp;r=xyhQt"></script>
<!--
The Civi-Angular modules require certain data be available. This example is bad because the data is loaded
after the modules.
-->
<script type="text/javascript" src="http://d46.demo.civicrm.org/sites/all/modules/civicrm/bower_components/angular/angular.min.js?nnu1sv"></script>
<script type="text/javascript" src="/civicrm/ajax/angular-modules?format=js&amp;r=xyhQt"></script>
<script type="text/javascript">
var CRM={"config":...};
</script>
Notes:
v4.6.0 and v4.6.2 would present a bit differently. In v4.6.0, there are half a dozen
files loaded from civicrm/js/angular-*.js. In v4.6.2, those are consolidated into a single
request for civicrm/ajax/angular-modules?format=js. However, these have the same
ordering requirements -- they must appear *after* the "var CRM=..." snippet.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.