AngularJS - 在运行时检索工厂对象动态? [英] AngularJS - Retrieve factory object at runtime dynamically?
问题描述
我想知道是否有可能得到一个特殊的工厂对象动态(不使用依赖关系注入)。所以,如果我有模块的名字,我的工厂名称可以做一些事情来检索工厂对象本身?
I would like to know if it is possible to get a particular factory object dynamically (without using dependancy injection). So if I have the module name and the factory name can I do something to retrieve the factory object itself?
编辑:$提供和$喷油器可能是在正确的方向
$provide and $injector might be in the right direction?
推荐答案
根据上述您的评论:
这个问题已经被无数人解决。角有内置的支持,只要你准备好了手动自举一个应用程序。有一堆关于如何做到这一点的在线教程。然而,回答您的问题可以通过以下SO后发现:
This problem has been solved by numerous people. Angular has built-in support for manually bootstrapping an app whenever you're good and ready. There are a bunch of online tutorials for how to do this. However, the answer to your specific problem can be found in the following SO post:
希望有所帮助。
这篇关于AngularJS - 在运行时检索工厂对象动态?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!