marmelab / ng-admin

Add an AngularJS admin GUI to any RESTful API
http://ng-admin-book.marmelab.com/
MIT License
3.95k stars 725 forks source link

possible to add url link within field template? #1342

Closed ghiewa closed 7 years ago

ghiewa commented 7 years ago

like,

nga.field('Download', 'template')
            .template((entry) => `<a href="http://testurl.com/${entry.values.id}" />`),

aim to have a link in showView, can lead user to down some file from the server. Or alternative way to go?

Kmaschta commented 7 years ago

Yes it is. Just format a valid tag such as:

nga.field('Download', 'template')
-    .template((entry) => `<a href="http://testurl.com/${entry.values.id}" />`)
+    .template((entry) => `<a href="http://testurl.com/${entry.values.id}">Download</a>`),

I make it work in a Plunker snippet (see Users list).

I close the issue, feel free to ask your next questions on StackOverflow with the tag ng-admin.