Angularjs加载多次。NETMVC项目

Angularjs加载多次。NETMVC项目,angularjs,asp.net-mvc,Angularjs,Asp.net Mvc,我在asp.NETMVC项目中使用角度路由,在从mvc控制器传递参数并将其显示在视图中(我希望从mvc传递用户id)时收到如下警告。有谁能帮我解决这个问题,以及如何使它异步 "Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check http://xhr.spe

我在asp.NETMVC项目中使用角度路由,在从mvc控制器传递参数并将其显示在视图中(我希望从mvc传递用户id)时收到如下警告。有谁能帮我解决这个问题,以及如何使它异步

"Synchronous XMLHttpRequest on the main thread is deprecated because 
of its detrimental effects to the end user's experience. For more help, 
check http://xhr.spec.whatwg.org/.
VM168:289WARNING: Tried to load angular more than once."
demoController.cs演示控制器页面

public ActionResult WithParams(int? type)
    {
        ViewBag.Type = type;
        return View();
    }
demo.cshtml视图


指向localhost的链接仅在您的计算机上可用。在浏览器中检查HTML,查看是否有多个元素试图加载。如果有,你需要弄清楚他们是从哪里来的。您在问题中输入的大部分代码似乎都是无关的。虽然您添加了显示angularjs初始化的代码,但这个错误显然与两次加载angular.js有关。您可以将它放在视图的@scripts部分和_layout.cshtml上,或者在bundle.config中放两次。难说
    @{ 
      ViewBag.Title = "WithParams"; 
       }

<h2>WithParams</h2>

@if(ViewBag.Type==1)
{
    <p>You passed 1</p>
}
else
{
    <p>You Passed 2</p>
}
    angular.module('app',['ngRoute']).config(['$routeProvider',  function($routeProvider) {
    $routeProvider.
      when('/demo', {
        templateUrl: 'demo/demo',
        controller: 'demoCtrl'
      }). otherwise({
        redirectTo: '/'
      });
  }]).controller('dashCtrl' , function($scope){console.log("demo page")
}