Forum


HomeHomePremiumPremiumDevelopmentDevelopmentAngular is not defined ErrorAngular is not defined Error
Previous
 
Next
New Post
5/22/2015 6:35 AM
 

Hello, If this question was already posted I apologize. I downloaded the angular module from the dnnhero advanced module dev tutorial video and added it to a test page, but when the page loads I am getting the error "Uncaught ReferenceError: angular is not defined" for the line 

dnnuclear.ItemApp = angular.module("dnnuclear.ItemApp", ['ngDialog']);
Could this be caused by a new version of angular? I created a new module to test the bootstrapping and am getting the exact same error. Any insight would be appreciated.

 

 
New Post
5/22/2015 7:36 AM
Accepted Answer 

Hello Adam,

I'm no expert but I've been working on angular apps based off the angular template. I can't help you fix your error however I think I can help you get your feet wet getting a basic working angular module up. There's a few things I've narrowed down that you have to have to get started:

First in your code behind during the pre-render register angularjs, your view, and your app:

I named my script app.js.

Your second line of your view should have:

In your view (I don't think it matters if it's on the top or bottom of the page add your bootstrapping:

Then your script should look like so:

You don't need ngDialog unless you know what it is (I believe it's for modal support which is used in the template example code). Change the name of your app to whatever you want and make sure you register it and call it properly from your view. With this setup any angular code I use works properly.

Hope this helps.

 
New Post
5/22/2015 8:00 AM
 

One thing I forgot was to ask if you installed the AngularJS library before adding the module to the page? Here's a link to the download. It's on the top right angularjs_1.2.27.zip

Install it just like any other module. That's probably why you're getting the error.

Hope that helps.

 
New Post
5/22/2015 8:27 AM
 
Thanks Michael that was it! I forgot to install AngularJS library. Thanks a lot for your help.

-Adam

 
Previous
 
Next
HomeHomePremiumPremiumDevelopmentDevelopmentAngular is not defined ErrorAngular is not defined Error



Try FREE
30 days money back guaranteed