search

Home  >  Q&A  >  body text

angular.js - Angularjs has multiple modules, and each module sets the same router state. Is this feasible?

Angularjs has multiple modules, and each module sets the same router state. Is this feasible?

阿神阿神2757 days ago672

reply all(1)I'll reply

  • 我想大声告诉你

    我想大声告诉你2017-05-15 16:52:48

    Not feasible.

    state is the state of the application, not the state of the module, but it is configured through the module's config interface.

    Unless each of your modules is a completely independent application, multiple modules define the same state. Which one should be run when the state is activated? Using ui.router will throw an exception directly.

    But multiple states can be defined in multiple modules belonging to the same app, and there can be a parent-child relationship.

    reply
    0
  • Cancelreply