Angularjs Routerprovider configuration error

Asked

Viewed 43 times

2

I imported the angular-route.js and made the following configuration :

  <script type="text/javascript">
   angular.module("layoutxepa",["ngRoute"]);

   angular.module("layoutxepa").config(function (serialGeneratorProvider) {
     serialGeneratorProvider.setLength(5);
   });

   angular.module("layoutxepa").config(function ($routeProvider) {

   });

 </script>

Follows the Error

 Uncaught Error: [$injector:modulerr] Failed to instantiate module  layoutxepa due to:
 Error: [$injector:unpr] Unknown provider: serialGeneratorProvider
  • serialGeneratorProvider is not defined. Check if the file responsible for your configuration is being loaded, and if the service is being added to Angular startup.

  • @Onosendai the serialgenerator.js file was not being imported . obg by return

  • Always a pleasure - I’m glad the tip has solved your problem!

1 answer

1


The problem was that the file

serialGenerator.js

was not being imported.

<script src="src/main/webapp/app-content/js/serialGenerator.js"></script>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.