我有一个像这样的离子模式:
$ionicModal.fromTemplateUrl('templates/my-modal.html', {
scope: $scope,
animation: 'slide-in-up'
}).then(function(modal) {
$scope.modal = modal
$scope.modal.show()
})
模态看起来像这样:
<ion-modal-view ng-controller="EditCtrl" class="modal">
<ion-header-bar class="modal-header-bar">
<button class="button button-clear">Cancel</button>
<h1 class="title">Edit</h1>
<button class="button button-clear">Save</button>
</ion-header-bar>
<ion-content>
<div id="foo"></div>
</ion-content>
</ion-modal-view>
然后在edit_controller.js
:
document.getElementById('foo')
返回null。如何document
引用当前显示的模态?