How to load html from templateURLinto AngularJS directive in django-built application. Whenever I specify a URL in a variable templateURL, it reaches the django server. How can i implement this? Can I give the django url in a variable templateURLin directives and display the HTML there in django? What is the right way to do this?
My directive:
app.directive('test', function()
{
return{
restrict: 'E',
templateUrl: 'test.html'
}});
It reaches django's server someURL/test.htmland returns 404.
Can I implement this method?
app.directive('test', function()
{
return{
restrict: 'E',
templateUrl: 'app/test'
}});
and in django urls.py
url(r'^test/$', TemplateView.as_view(template_name='test.html'))
Is this a good way to do this? What is the right way?
mithu source
share