0

I have a feature that has controllers, services, and templates in it which I want to use in two separate projects. I've put template and controller names into a constant so I can change if I need. It works almost perfect.

However, in a view, I need to get options of a ui-select differently in these projects. It will be an array from $rootScope in both of them but comes from different variables. I think I cannot use constant, so what can I use?

yogurt
  • 380
  • 1
  • 10
  • 1
    So, where's the question? – Johannes Jander Feb 02 '16 at 16:11
  • Updated it. Is it clear now? – yogurt Feb 02 '16 at 19:51
  • Why not either write a service that reads from the different variables but spits out an array in both cases? This service would be different for the two projects, but its customers only need this service s a dependency. Alternatively, use `$emit` or `$broadcast` to broadcast data to the controller feeding the ui-select. – Johannes Jander Feb 03 '16 at 08:55

0 Answers0