javascript - What is the correct order of loading AngularJS files? -


i encountered problem angularjs webpages don't load sometimes. when happens, code in corresponding controller not run. happens rarely. suspect due loading order of angularjs files. perhaps there other possible causes. please alert me if can think of any. below code showing loading order of html page;

    <script src="lib/angular/angular.min.js"></script>     <script src="lib/angular/angular-route.min.js"></script>     <script src="js/app.js"></script>     <script src="js/services.js"></script>     <script src="js/controllers.js"></script>     <script src="js/filters.js"></script>     <script src="js/directives.js"></script>             <script src="vendor/dialogs.min.js" type="text/javascript"></script>            <script src="lib/angular/angular-sanitize.min.js"></script>        <script src="vendor/angular-translate.min.js"></script>       <link href="vendor/dialogs.css" rel="stylesheet">    

is there wrong?

first load angular library:

<script src="lib/angular/angular.min.js"></script> <script src="lib/angular/angular-route.min.js"></script> <script src="vendor/dialogs.min.js" type="text/javascript"></script>        <script src="lib/angular/angular-sanitize.min.js"></script>    <script src="vendor/angular-translate.min.js"></script>   

after load controllers, services, filters, directives

<script src="js/services.js"></script> <script src="js/controllers.js"></script> <script src="js/filters.js"></script> <script src="js/directives.js"></script>         

finally, can load app init file

<script src="js/app.js"></script> 

Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -