Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
216 views
in Technique[技术] by (71.8m points)

c# - display achor tag in angular Js expressions

I am not able to display the anchor tag inside the AngularJS expression. The problem is that when I am trying to display an anchor tag as an icon which is being fetched from the API, it's only displaying the raw path as

a href='../UserControls/DownloadRLCSFile.ashx?Path=\dotnetdevcsvRLCSDocumentsRegistrationsABACFE.S.I.C. RegistrationSample.xlsx' target='_blank' download><i class='fa fa-download' style='font-size: 13pt;' ></i></a>

Please find the below code:

<div id="Div2" ng-controller="BasicRegulatoryDetail"> 
  <h4 class="padder-sm  b-b"><b>Regulatory Updates</b></h4>

  <div>
    <div class="table-responsive">
      <table class="table table-striped bg-white ">
        <tbody>
          <tr ng-repeat="bs in BasicInfo" >
            <td><asp:HyperLink ID="HyperLink1" NavigateUrl="~/RLCS_Connect/RegulatoryUpdateDetails.aspx?Subject={{bs.Subject}}" runat="server">{{bs.Subject}}</asp:HyperLink></td>  
            <td>{{bs.Document_Path}}</td> //here i am facing the problem
          </tr>
        </tbody>
      </table>
    </div>
  </div>
</div>
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Sounds like you might need ng-href:

https://docs.angularjs.org/api/ng/directive/ngHref

The wrong way to write it:

<a href="http://www.gravatar.com/avatar/{{hash}}">link1</a>

The correct way to write it:

<a ng-href="http://www.gravatar.com/avatar/{{hash}}">link1</a>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...