2

I have issues with data values in a table and I'm trying to wrap the data in anchor tags so that it can be a downloadable link i tried to use ng-href but i can use target. is there an easier way of doing this? i was the data to show normally on the browser and have use click on it to download an image. but it shows an ugly anchor tag as well :/ this is my code with normal a href i have tried using this as well, which was an answer for angular.js link behaviour - disable deep linking for specific URLs

<td><a target="_self" href="//tomcmmsweb.pca.com/DocumentLibrary/Download/{{item.documentId}}">{{item.jobNumber}}</a></td>

but above still didnt work. im using angularJS 1.2.16, im running out of ideas and im notthat much of an expert with angularJS. would really appreciate some knowledge.

<table class="table table-striped table table-hover">
    <thead>
    <tr>
        <th>Project Manager</th>
        <th>Job Number</th>
        <th>Description</th>
        <th>Amount</th>
    </tr>
    </thead>
    <tbody>
    <tr ng-repeat="item in counce">
        <td><a href="//coucmmsweb.pca.com/DocumentLibrary/Download/{{item.documentId}}" target="_blank">{{item.projectManager}}</a></td>
        <td><a href="//coucmmsweb.pca.com/DocumentLibrary/Download/{{item.documentId}}" target="_blank">{{item.jobNumber}}</a></td>
        <td><a href="//coucmmsweb.pca.com/DocumentLibrary/Download/{{item.documentId}}" target="_blank">{{item.description}}</a></td>
        <td><a href="//coucmmsweb.pca.com/DocumentLibrary/Download/{{item.documentId}}" target="_blank">{{item.totalAmount*1000 | currency}}</a></td>
    </tr>

    </tbody>
</table>

enter image description here

Sourav
  • 393
  • 2
  • 18
Edgar
  • 543
  • 10
  • 20
  • 1
    Works completely perfect for me? [Plunker](http://plnkr.co/edit/HuKMySzruD8c454A90aZ?p=preview). Note: I'm using AngularJS 1.4 – RiesvGeffen Jan 07 '16 at 12:56
  • i wonder if this was something that was fixed in 1.4? – Edgar Jan 07 '16 at 13:14
  • This is a [Plunker](http://plnkr.co/edit/Cg0p7mWwwWOpj1WI1ssy) with AngularJS 1.2, and still word perfect. – RiesvGeffen Jan 07 '16 at 13:18
  • wonder why mine wont :/ – Edgar Jan 07 '16 at 13:37
  • I made some changes. but doesnt work i keep reading about $locationProvider.html5(true); but where would i put that, the angularJS file is reference in a script tags in the index.html file, angular controller is app.js and then i have another angularJS "controller" that is for specfic pages – Edgar Jan 07 '16 at 15:11
  • also have this in my routes.je $locationProvider.html5Mode(true); – Edgar Jan 07 '16 at 15:22

0 Answers0