2017-05-01 11 views
1

'findCharityHome.ts' typescriptクラスに変数 'c​​ontent'があります。角度2のtypecriptクラスの変数の中に角度2の属性を追加する方法

  let content = ` 
      <b>`+header+`</b> 
      <button style='background-color:#428bca;color:white;padding:5px;'>View Profile</button> 
     `; 

さらに、私は解決策

this.navCtrl.push(myProfilePage)を見つけることができませんでした別のpage.Butに移動するボタンクリックイベント以上に次のコードを追加します。





これはtypescriptですクラスで記述された方法の私の完全なコードです。

addCluster(map){ 
    if(google.maps){ 

     //Convert locations into array of markers 
     let markers = this.locations.map((location) => { 
      let marker = new google.maps.Marker({ 
       position: location, 
       animation: google.maps.Animation.DROP, 
      }); 
      let header = 'some'; 
      let content = ` 

      <b>`+header+`</b> 
      <button style='background-color:#428bca;color:white;padding:5px;'>View Profile</button> 
      `; 
      this.addInfoWindow(marker, content); 
      return marker; 
     }); 
     this.markerCluster = new MarkerClusterer(map, markers,{imagePath: 'assets/m'}); 
    } 
} 

答えて

1

あなたはあなたの例class.In角度2 typescriptですで変数内の角2つの属性を追加することはできません、あなたはあなたの変数のテンプレートを追加し、それはtypescriptです属性は、ここでは動作しませんwork.Butあり!

関連する問題