Forum


HomeHomePremiumPremiumDevelopmentDevelopmentAngularJS DirectivesAngularJS Directives
Previous
 
Next
New Post
5/14/2015 8:26 AM
 

Hello,

Been working with an AngularJS module and have made decent progress applying techniques. However today my goal was to start using directives in my html and I can't quite get it to work. I have a working and non-working template: 

This functions perfectly as it should however if I switch to a 'templateUrl' I can't get it to work. I have html file with the same code in it that I'm trying to use in my module:

 <div>Hello World!</div>

In my ascx:

I've tried every possible path I could think of but my chrome developer network tab always returns 'error 404 non found'. It dawned on my that since the file isn't actually a page on my server perhaps that's why it won't load? I've done a lot of research on the various issues I can have and I've run out of things to google. I tried using ng-include as well but that didn't help either. Is there some way I can possibly get this to work in DNN?

Thanks.

 
New Post
5/14/2015 9:47 AM
 

Alright I finally got my directive working (yay!) With A LOT of research I found this post which at first didn't look like it would be of much help. The trick was to set the base file path to your file structure instead of your sites structure:

Simply add this line to the top of your acsx, under your control and register of course, then in your template reference your html path:

In your template like such:

I edited my html and refreshed the page just to make sure I was dreaming:

^ what's displayed in my module.

Thanks. Hope this helps someone.

 
New Post
5/14/2015 2:12 PM
 

Michael,

Sorry I was too late to help you, but nice job getting it to work!  Thanks for posting this, I am sure this will save people time.

 
Previous
 
Next
HomeHomePremiumPremiumDevelopmentDevelopmentAngularJS DirectivesAngularJS Directives



Try FREE
30 days money back guaranteed