当前位置: 动力学知识库 > 问答 > 编程问答 >

angularjs - Calling angular bootstrap on an element which has a child element that has been bootstrapped

问题描述:

I'm getting an error when calling angular bootstrap on an element which has a child element that has already been bootstrapped:

Unknown provider: myServiceProvider <- myService

Here's the call on the child

angular.bootstrap($('#child'), ['mod1']);

And here's the call on the parent

angular.bootstrap($('body'), ['modA', 'modB']);

If I include 'mod1' in the bootstrap call on the parent then it seems to work.

Is what I'm trying to do here bad practice?

网友答案:

The comments above the bootstrap function say that apps cannot be nested. Search 'nested' here

分享给朋友:
您可能感兴趣的文章:
随机阅读: