MD Ghouse MD Ghouse - 1 month ago 10
AngularJS Question

Failed to instantiate module MyApp due to

In my App.js when i added "var app = angular.module('MyApp', ['ngRoute.dirPaginate'])" im getting this Error if i Remove ngRoute its working fine.

Error: [$injector:nomod] Module 'dirPaginate' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
http://errors.angularjs.org/1.5.6/$injector/nomod?p0=dirPaginate

MYApp.Js

var app = angular.module('MyApp', ['ngRoute.dirPaginate'])


_Layout.Cshtml

<body ng-app="MyApp">

<div class="container body-content">
@RenderBody()
@*<hr />
<footer>
<p>&copy; @DateTime.Now.Year - My ASP.NET Application</p>
</footer>*@
</div>

@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/bootstrap")
@Scripts.Render("~/bundles/angular")


<script src="~/Scripts/MyApp.js"></script>
@RenderSection("scripts", required: false)
</body>

Answer

change ut var Myapp to

var app = angular.module('MyApp', ['angularUtils.directives.dirPagination', 'ngRoute'])