0

When I follow the direct link /blog/3 on localhost everything works fine. After publishing to webserver the page constantly reloads and I get 'warning: tried to load angular more than once' in Chrome console.

var app = angular.module("myApp",
[
    'ngAnimate',
    'ngRoute',
    'LocalStorageModule',
    'slickCarousel',
    'noindex-svg',
    'svg-use'
    // 'ui.router'
]
);

app.config(function ($routeProvider, $locationProvider) {

$routeProvider.when("/", {
    controller: "mainController",
    templateUrl: "/app/views/dashboard/main.html"
});

$routeProvider.when("/blog/:name", {
    controller: "blogController",
    templateUrl: "/app/views/blog/blog-details.html"
});

$routeProvider.when("/blog", {
    controller: "blogController",
    templateUrl: "/app/views/blog/blog-list.html"
});

if (window.history && window.history.pushState) {
    $locationProvider.html5Mode({
        enabled: true,
        requireBase: false
    });
}    

});

I am using asp.net web api 2 and Azure app. Why does it happen only on the webserver?

Dazhush
  • 1,575
  • 1
  • 12
  • 18
  • You have to have a require('angular') somewhere. –  Dec 10 '18 at 20:10
  • 1
    This may be a duplicate of this question https://stackoverflow.com/questions/23499853/warning-tried-to-load-angular-more-than-once-angular-js – Andrew Lahikainen Dec 11 '18 at 03:26
  • I read the question, not one of the suggested answers worked. It may be connected to Azure app configuration – Dazhush Dec 11 '18 at 07:55

0 Answers0