0

Im developing app that will work only in corporate network which doesn't have internet and is hosted in IIS, asp.net mvc architec. In development stage i want to use some bugtrackers and tasks feature, which implemented with firebase, and in production mode i will disable firebase via bundle config (if #debug or #release). So in production mode im gonna disable firebase (would not load firebase script) Is there any workaround to load dependency only if it exists? Looked at Optional dependency but i dont think that try catch is best way to go. Any ideas?

Community
  • 1
  • 1
Medet Tleukabiluly
  • 11,662
  • 3
  • 34
  • 69
  • Could you replace the module with an empty module when in Production mode? – runTarm Jul 25 '14 at 15:19
  • Try and catch is the best way. Or you could use the directory class and check for the file – Hillboy Jul 25 '14 at 15:28
  • Another workaround is to monkey patch `angular.module` and remember registered module yourself. – runTarm Jul 25 '14 at 16:00
  • The best answer here would be to make this part of your build process. Short of that, try/catch is going to be your friend. – Kato Jul 25 '14 at 16:54
  • solved with bundle, made copy of app.js, and in release mode, i will use this one which doesnt include firebase deps `if #debug #release`.. not perfect, still waiting for elegant solution – Medet Tleukabiluly Jul 26 '14 at 09:03

0 Answers0