2017-04-11 2 views
-1

저는 AngularJS를 사용합니다. 나는 ng-click, ng-mouseover와 같은 AngularJS의 동적 인 내용 및 몇몇 기능을 가진 InfoBubble을 제시하고자합니다. InfoWindows를 사용하여 먼저 html을 컴파일 한 다음 컴파일 된 html을 InfoWindow의 콘텐트로 설정해야했습니다. 불행히도 InfoBubbles에서는 작동하지 않습니다. 정적 html을 추가 할 때 문제가 없지만 컴파일 된 html을 추가하면 내용이없는 것처럼 보입니다.AngularJS를 사용하여 InfoBubble의 동적 콘텐츠를 설정하는 방법은 무엇입니까?

var htmlElement = '<div ng-include="\'/home/include/infoBubble.html\'"></div>' 
var compiled = $compile(htmlElement)($scope) 
infoWindow = new InfoBubble({ 
     content: compiled[0], 
     shadowStyle: 1, 
     padding: 0, 
     backgroundColor: 'rgb(57,57,57)', 
     borderRadius: 4, 
     arrowSize: 10, 
     borderWidth: 1, 
     borderColor: '#2c2c2c', 
     disableAutoPan: true, 
     hideCloseButton: true, 
     arrowPosition: 30, 
     backgroundClassName: 'phoney', 
     arrowStyle: 2 
    }); 
infoWindow.open(vm.map, marker); 

답변

0

문제점은 최대 높이와 ​​최소 높이 및 너비가 없었습니다. 그것들을 설정하면 문제가 해결됩니다.

관련 문제