2017-05-01 2 views
1

'findCharityHome.ts'typescript 클래스에 다음과 같이 'content'변수가 있습니다.각도 2 typescript 클래스의 변수 안에 각도 2 속성을 추가하는 방법

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

는 또한, 내가 솔루션

this.navCtrl.push (myProfilePage를) 찾을 수 없습니다 다른 page.But로 이동 위의 버튼 클릭 이벤트에 다음 코드를 추가 할;





이 타이프 클래스 작성 방법의 내 전체 코드입니다

.

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 타이프의 변수 안에 각 2 개 속성을 추가 할 수 없습니다, 당신은 당신의 변수에 대한 템플릿을 추가하고 그것을 타이프 라이터가 여기에 작동하지 않습니다 속성 직장까지 할 수있다!