2016-06-26 8 views
0

私は顧客の名前を表示する必要があるAngularJsアプリケーションに取り組んでいますが、彼のメールアドレスに電子メールでリンクするにはメールを送るべきです。 例:名前がBobと電子メールである場合には、私は電子メールのプロパティを持っているanglejs内の名前へのmailtoのリンクを表示

<div class="form-group mg-t20" ng-hide="!groupObj.accountExecutiveName"> 
      <label class="wd50p control-label left fw-norm">Account Executive:</label> 
      <div class="wd48p blue-txt"> 
       {{groupObj.accountExecutiveName}} 
      </div> 
     </div> 

以下のようにのようにボブのクリック時に、それは[email protected]

私のhtmlへのメールを表示する必要があり、[email protected]です。そのgroupObj.accountExecutiveEmailどのように私はhtmlでこれを行うのですか?

答えて

1

次のコードでは、あなたのケースで動作するはずです:

<a ng-href="mailto:{{ groupObj.accountExecutiveEmail }}" target="_blank"> 
    {{ groupObj.accountExecutiveName }} 
</a> 

だからあなたの最終的なHTMLは次のようになります。

<div class="form-group mg-t20" ng-hide="!groupObj.accountExecutiveName"> 
    <label class="wd50p control-label left fw-norm">Account Executive:</label> 
    <div class="wd48p blue-txt"> 
     <a ng-href="mailto:{{ groupObj.accountExecutiveEmail }}" target="_blank"> 
     {{ groupObj.accountExecutiveName }} 
     </a> 
    </div> 
</div> 

乾杯を!

1

ちょうどあなたがあなたのテンプレートにこのような何かを追加することができますmailtoリンク

<a ng-href="mailto:{{groupObj.accountExecutiveEmail}}">Send email</a> 
2

を使用します。<a>タグで

<a ng-href="mailto:{{groupObj.accountExecutiveEmail}}" target="_blank"> 
    {{groupObj.accountExecutiveName}} --> here will be the item's name 
</a> 
関連する問題