laurelnaiad / angular-couch-potato

Lazy-Load and Register Components in AngularJS Applications
Other
104 stars 19 forks source link

How to load the Main Controller? #8

Closed jackzhu2012 closed 10 years ago

jackzhu2012 commented 10 years ago

I am trying the sample codes, it's really nice to lazy load controllers in the routes, but failed to load the Main controller and causing error with the "ng-controller='MainCtrl'" in index.html. Is there a best practice for loading main controller for ng apps?

laurelnaiad commented 10 years ago

If you specify the controller in your index.html, it seems to me the default solution is to not lazy load it. In fact, since this controller is needed throughout the app's lifetime, it makes sense to build it into your main module.

laurelnaiad commented 10 years ago

Do you have some more information @seaeye777 ? It should work.

laurelnaiad commented 10 years ago

Hi @seaeye777. You can use http://plnkr.co/ to create a small demonstration of the problem you're having if you'd like to seek help with a couch-potato problem here.

laurelnaiad commented 10 years ago

We can reopen this if you want to provide a small plunker.