Hi everyone,

I work with AngularJS only recently and came over a strange behaviour with 
it.
I'm working on local server with WAMP and when I load my website the first 
time on any browser (Chrome, Firefox, IE), it seems AngularJS doesn't load 
because none of my ng-repeat nore angular variables are executed.

But If I reload the page (F5), it works like a charm and all the pages of 
the website work.
Also, if I close my browser and re-open it, it works.

Another point, if I restart the services of WAMP, the problem appears again.
And finally what is very strange is that : 
 - if I open the site a first time on Chrome (for ex.) > it bugs ; if I 
then open it on Firefox > it works
 - I restart the services on WAMP
 - if I open the site a first time on Firefox > it bugs ; if I then open it 
on Chrome > it works

It seems the first time I open it on any browser, something is happening in 
wamp config and the next time it will work.
But I want it to work on the first load ! :)

Here is the bug report I have on the first load :
angular.min.js:107 Error: [ngRepeat:dupes] 
http://errors.angularjs.org/1.4.4/ngRepeat/dupes?p0=surveyTmp%20in%20ListSurveys%20%7C%20limitTo%3A10&p1=string%3A%3C&p2=%3C
    at Error (native)
    at http://localhost:8080/briefunique/js/angular.min.js:6:416
    at http://localhost:8080/briefunique/js/angular.min.js:279:39
    at Object.fn 
(http://localhost:8080/briefunique/js/angular.min.js:129:227)
    at n.$digest 
(http://localhost:8080/briefunique/js/angular.min.js:130:310)
    at n.$apply 
(http://localhost:8080/briefunique/js/angular.min.js:133:330)
    at g (http://localhost:8080/briefunique/js/angular.min.js:87:340)
    at K (http://localhost:8080/briefunique/js/angular.min.js:91:406)
    at XMLHttpRequest.A.onload 
(http://localhost:8080/briefunique/js/angular.min.js:92:437)

Here is how I create the AngularJS app :
var briefuniqueApp = angular.module('BriefUnique', 
['ngRoute','angular-szn-autocomplete']);

briefuniqueApp.config(['$routeProvider',
    function($routeProvider) { 
        // Système de routage
        $routeProvider
        .when('/accueil', {
            templateUrl: 'pages/accueil.html',
            controller: 'accueilCtrl'
        })
        .when('/newsurvey', {
            templateUrl: 'pages/newsurvey.html',
            controller: 'newsurveyCtrl'
        })
        .when('/project/:projectId', {
            templateUrl: 'pages/project.html',
            controller: 'projectCtrl'
        })
        .when('/brief/:briefId', {
            templateUrl: 'pages/brief.html',
            controller: 'briefCtrl'
        })
        .when('/fieldwork/:briefId', {
            templateUrl: 'pages/fieldwork.html',
            controller: 'fieldworkCtrl'
        })
        .when('/testmaterial/:briefId', {
            templateUrl: 'pages/testmaterial.html',
            controller: 'testmaterialCtrl'
        })
        .otherwise({
            redirectTo: '/accueil'
        });
    }
]).run(['$rootScope', '$location', '$http', function($rootScope, $location, 
$http){

    /* Global Variables */
    $rootScope.ResearchSelected = false;
    $rootScope.BriefSelected = false;
    $rootScope.NbSelectedCountries = 0;

}]);

Here is how I load the javascript files :
<script src="js/jquery-3.1.0.min.js"></script>
<script src="js/bootstrap.min.js"></script>
    <script src="js/angular.min.js"></script>
    <script src="js/angular-route.min.js"></script>
    <script src="js/angular-szn-autocomplete.js"></script>
    <script src="js/bootstrap-select.js"></script>
    <script src="js/bootbox.min.js"></script>
    <script src="js/bootstrap-toggle.min.js"></script>
    <script src="js/jquery.stickytableheaders.min.js"></script>

    <script src="js/fixed-issues.js"></script>

    <script src="app/BriefUniqueApp.js"></script>
    <script src="app/Controllers_Accueil.js"></script>
    <script src="app/Controllers_NewSurvey.js"></script>
    <script src="app/Controllers_Brief.js"></script>
    <script src="app/Controllers_Project.js"></script>
    <script src="app/Controllers_Fieldwork.js"></script>
    <script src="app/Controllers_TestMaterial.js"></script>


Is there anyone who had this problem ?

Thanks for your help.
Best regards

-- 
You received this message because you are subscribed to the Google Groups 
"Angular" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to