0
我想點擊它後得到一個元素的$索引,然後將它傳遞到$ md.Dialog.show,形象化什麼我嘗試做:
<div ng-repeat="picture in card.pictures" style="background-image: url({{picture.url}})" class="user-image" ng-click="showAdvanced($event,$index,card.pictures)"></div>
,然後我會
$scope.showAdvanced = function(e,i,pictures) {
$log.log(i);
$scope.pictures = pictures;
$mdDialog.show({
scope: $scope.$new(),
controller: DialogController,
templateUrl: 'user.details.html',
parent: angular.element(document.body),
targetEvent: e,
clickOutsideToClose:true,
fullscreen: false
}).then(function(i){
$('.lightbox-img').eq(i).focus();
});
};
我已經設置了.lightbox-img
的tabindex="0"
,但它似乎沒有通過。