Uncaught Error: [$injector:modulerr]
i get this
Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.2.20/$injector/modulerr?p0=main&p1=Error%3A%2…dflare.com%2Fajax%2Flibs%2Fangular.js%2F1.2.20%2Fangular.min.js%3A18%3A139) angular.js:3848
I have the same error ! Warning the name in the view (index.cshtml)
... @Scripts.Render("~/bundles/AwesomeAngularMVCApp") My application is called MVCAngularJS. :) it's to work now ! :)
My answer: /****Index.cshtml****/
{{models.helloAngular}}
<script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.20/angular.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.20/angular-route.min.js"></script>
@Scripts.Render("~/bundles/AngularJSMVC")
/_AngularJSMVC.js_*/ var app = angular.module('AngularJSMVC', ['ngRoute']);
app.controller('LandingPageController', ['$scope', function ($scope) { $scope.models = { helloAngular : 'I work' } }]);
/_BundleConfig.cs_**/ using System.Web; using System.Web.Optimization;
namespace AngularJSMVC { public class BundleConfig { // For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862 public static void RegisterBundles(BundleCollection bundles) { bundles.Add(new StyleBundle("~/Content/css").Include( "~/Content/site.css"));
bundles.Add(new ScriptBundle("~/bundles/AngularJSMVC")
.IncludeDirectory("~/Scripts/Controllers", "*.js")
.Include("~/Scripts/AngularJSMVC.js"));
BundleTable.EnableOptimizations = true;
}
}
}
Regards.