Reputation: 815
I am trying to add some front end pages in Angular to the my ckan extension. But with the Jinja templating in ckan I am finding it really hard to achieve this. I need to know if this is possible / supported (with any version of angular).
If this is supported, can someone please share any example where this is integrated. If not what are my options of achieving this in ckan.
Thanks.
Upvotes: 0
Views: 324
Reputation: 535
It was a long time ago, and it's not very pleasant, but it is possible, e.g.: https://github.com/smartlane/ckanext-smartlane/blob/master/ckanext/smartlane/templates/package/analyses.html https://github.com/smartlane/ckanext-smartlane/tree/master/ckanext/smartlane/fanstatic/app
Key things to watch out for are getting the JS loaded properly: https://github.com/smartlane/ckanext-smartlane/blob/master/ckanext/smartlane/fanstatic/resource.config#L2
And stopping Jinja templating from reading the Angular templating with the {% raw %} tag: https://github.com/smartlane/ckanext-smartlane/blob/5e5c51bb355061789069f329ff33b4a8e8844c0e/ckanext/smartlane/templates/package/analyses.html#L13
That repository is a bit hard to navigate; you probably want to only look at the state at revision 5e5c51bb355061789069f329ff33b4a8e8844c0e, i.e. https://github.com/smartlane/ckanext-smartlane/tree/5e5c51bb355061789069f329ff33b4a8e8844c0e/ckanext/smartlane
Hope that helps!
Upvotes: 1