위치의 세부 정보를 표시하려는 코드바 앱이 있습니다. 어떤 이유로 JS에 성공적으로 할당 된 HTMl에 변수를 표시하려고 시도하면 아무 것도 나타나지 않습니다.
JS 컨트롤러 :
app.controller('placeCtrl', function($scope, LocDat){
LocDat.async().then(function(d){
$scope.item= places.selectedItem;
$scope.locs = [];
for(var i=0; i<d.length; i++){
if(d[i].attributes.Joint.id === places.selectedItem.id){
getDistance(d[i]);
$scope.locs.push(d[i]);
}
}
$scope.showSite = function(){
//var ref = navigator.app.loadUrl($scope.item.attributes.Website, '_blank');
var ref = window.open($scope.item.attributes.Website,'_blank','location=yes');
}
$scope.showDetail = function(index){
var selectedItem = d[index];
d.selectedItem = selectedItem
$scope.l = selectedItem;
console.log($scope.l.attributes.City);
$scope.ons.navigator.pushPage('location_detail.html', { title : d.selectedItem.attributes.Address });
}
});
HTML : 콘솔 출력의
<!DOCTYPE html>
<html>
<body>
<div ng-controller="placeCtrl">
<ons-page class="center" ng-device-backbutton="myNavigator.popPage()">
<ons-toolbar>
<div class="left"><ons-back-button ons-if-platform="ios">Back</ons-back-button></div>
<div id="title" class="center">{{l.attributes.City}}, {{l.attributes.State}}</div>
<!--<div class="left" onclick=".myNavigator.popPage()"><ons-back-button>Back</ons-back-button></div>-->
<!--<div class="center">Page 2</div>-->
</ons-toolbar>
<h2 align="center">Location Details Go Here</h2>
<!--enter more content here-->
</ons-page>
</div>
</body>
</html>
이미지 :
분명히 내 평판이 심각 하 게 ... 이미지를 게시 할 너무 낮습니다? 어쨌든 콘솔에 도시 이름이 성공적으로 표시되지만 쉼표 만 표시됩니다.
내가 제안한대로 포장했지만 지금은 내가 정의가 없다는 말을 듣고 있습니다 – deavisdude
jsfiddle에서 예제를 구할 수 있습니까? –
내가 이해할 수 없을 것 같습니다. jsfiddle에서 작동, cordova 애플 리케이션 에뮬레이터가 필요 플러스 그 내 파스 아이디를 포기해야합니다 – deavisdude