D
D
Dmitry Arushanov2015-02-10 17:27:06
Angular
Dmitry Arushanov, 2015-02-10 17:27:06

Correct work with ngRoute?

Good day to all.
There is such a situation. I have an application written in angular js. The application itself works well.
I decided to break the application into modules.
I will give a simple example. what happened.
there is a standard main module.

angular.module("MainApp", ["some dependences", "UserModule"]);

and there is a so called UserModule
which consists of user.controller, user.config etc
in each config there are the following
config(
    [
      '$routeProvider', function ($routeProvider) {
      return $routeProvider.when(
        '/locations', {
          templateUrl: '../views/location.html',
          title: 'Locations'
        }
      ).when(
        '/add-new-location', {
          templateUrl: '../views/add-new-location.html',
          title: 'New Locations'
        }
      ).
....

but when connecting modules to the main module, the routes do not work.
What could be the reason?
And yes, the ng-view directive does not work in the html index. She's just empty

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Pokrovsky, 2015-02-10
@MikeVazovsky

You have an error when building modules and the angular application simply does not start. Try disabling all modules and reconnecting them one by one. Check if all modules are working properly and if there are links to .js files that contain modules.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question