I get this error in all browsers: The following page has become unresponsive. You can wait for them to become responsive or kill them. And inspector element doesn't work
Layout:
<!DOCTYPE html>
<html ng-app="app">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>@ViewBag.Title</title>
<script src="~/Scripts/angular.js" type="text/javascript"></script>
<script src="~/Scripts/angular-resource.js" type="text/javascript"></script>
<script src="~/Scripts/angular-route.js" type="text/javascript"></script>
<script src="~/Scripts/app.js" type="text/javascript"></script>
</head>
<body>
<a href="/">Привет</a>
<div class="navbar navbar-inverse navbar-fixed-top" ng-controller="HttpController">
{{person.name}}
</div>
<div ng-view></div>
<div class="container body-content">
@RenderBody()
<hr />
<footer>
<p>© @DateTime.Now.Year - My ASP.NET Application</p>
</footer>
</div>
</body>
</html>
Script app.js:
(function() {
var app = angular.module("app", ["ngRoute"]).config(function ($routeProvider) {
$routeProvider.when("/", {
templateUrl: "/Home/TestView",
controller: 'HttpController'
});
});
app.controller("HttpController", function($http, $log, $scope) {
//var test = $http.get("http://localhost:58652/api/Values");
//$log.log(test);
$scope.person = { name: "Piker" }
});
})()
Homecontroller:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace Testangularjs.Controllers
{
public class HomeController : Controller
{
public ActionResult Index()
{
ViewBag.Title = "Home Page";
return View();
}
public ActionResult TestView()
{
ViewBag.Title = "111";
return View();
}
}
}
RouteConfig.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
namespace Testangularjs
{
public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
}
}
When I comment out the selected lines of routing angularjs in app.js, it works properly. Any ideas?