Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught Error: [$injector:modulerr] #2

Open
karneaud opened this issue Sep 8, 2014 · 2 comments
Open

Uncaught Error: [$injector:modulerr] #2

karneaud opened this issue Sep 8, 2014 · 2 comments

Comments

@karneaud
Copy link

karneaud commented Sep 8, 2014

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

@sauvef74
Copy link

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 ! :)

@NetRevolutions
Copy link

My answer:
/****Index.cshtml****/

<title ng-bind="models.helloAngular"></title>

{{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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants