Ui-router for systems with many modules

2

I came across a problem I have a Controller called OrderController that is in two modules, Sales and Supply. When I make the route to the screen that will use this controller how can I define which of the two controllers I want to use, how can I define which module I want the controller? I tried to register the route separately in each module, but it still does not work.

Complete Code: link

    
asked by anonymous 17.09.2016 / 22:53

1 answer

1

Would not it be best if each module had its own controller , each with its own name, and the logic that should be shared between the two controllers and a service ?

Example:

angular
  .module('sales.module',[])
  .controller('SalesController',SalesController);

angular
  .module('suply.module',[])
  .controller('SuplyController',SuplyController);

angular
   .module('outro.module',[])
   .service('OrderService',OrderService)

Or you can by this logic in a parent controller and these other two inherit the parent controller.

    
22.02.2017 / 14:39