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

6
  • 1
    Works completely perfect for me? Plunker. Note: I'm using AngularJS 1.4 Commented Jan 7, 2016 at 12:56
  • i wonder if this was something that was fixed in 1.4? Commented Jan 7, 2016 at 13:14
  • This is a Plunker with AngularJS 1.2, and still word perfect. Commented Jan 7, 2016 at 13:18
  • wonder why mine wont :/ Commented Jan 7, 2016 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 Commented Jan 7, 2016 at 15:11

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.