Closed hawkwind2 closed 10 years ago
If you are using version 0.2.X and above, you must return angularAMD.bootstrap(app) as it will create a version of app that allow for lazy loading.
Thank you @marcoslin, I'm using V0.2.0...but now I'm getting an error: "Unable to get property 'controller' of undefined or null reference", same controller code as above; My 'app' is undefined.. What I'm trying to do is route to .NET MVC controller, thus my templateUrl is pointing, hopefully, to my MVC controller e.g. templateUrl: '/Partials/Home' returning a PartialView. This is working for me on a different project using AngularJS non-lazy though. Please, any idea why am I getting this error?
If you app is undefined, it means that there is something wrong in you app.js or main.js.
Try to start with something simple, use template I created:
http://bl.ocks.org/marcoslin/df4b741e92b2829eeae8
Make sure that you relative path is set correct.
Cool! Works with MVC 5 now. Thanks!!! Created a separate project as you suggested and had changed the path for the main.js to "/Scripts/main.js" then changed the baseUrl: "Scripts" and placed the "app.js" in the same folder as "main.js" and the controllers as well. When I saw it's working :) I later had changed file location to suit my preferences.
I'm getting this error haven't found out why :
Well, I've replace the return under app.js with this: return app;
instead of: return angularAMD.bootstrap(app); But now the home controller is not loading at all...