I'm trying to create a component that can be re-used in multiple applications across my company, however I'm having trouble figuring out how to handle link generation.
For the sake of this example, let's say I have 2 applications - Alpha and Bravo. A standalone component of application Alpha may be used in either Alpha or Bravo. When the component generates anchors/links to resources in "Alpha", it needs to be somehow aware of what application it's currently in since in the "Alpha" case, the component should like use the `ui-sref` functionality from `ui-router` in order to transition state within the application. When the component is used in "Bravo", it seems like an absolute URL would need to be generated since not only do I not have my route definitions included, the application is on an entirely different domain. To complicate this a bit further, we have several different stages that an application can be deployed to ( i.e. devel, qa, production ). The link generation should be aware of the environment so that if "Bravo" is in devel or local development, then the links generated by the "Alpha" component should point to the development version of "Alpha". My initial thought on how to accomplish this is to create a Provider that you may configure during app bootstrapping and would provide a service with link generation helpers, however that doesn't help in the case where I feel like we should be using `ui-sref` ( Alpha Component in the Alpha Application ). Has anyone else encountered similar scenarios, and how would you suggest tackling something like this? -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscr...@googlegroups.com. To post to this group, send email to angular@googlegroups.com. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.