Unable to access html elements in modal from controller


#1

My HTML:

<ion-modal-view>
    <div id="foo">Hi
    </div>
</ion-modal-view>

My Controller:

$ionicModal.fromTemplateUrl('templates/mymodal.html', {
    scope: $scope,
    animation: 'slide-in-up'
}).then(function(modal) {
    $scope.modal = modal;
    console.log('clanDataScreen: ' + foo);
});

I get the following error: “Error: Can’t find variable: foo”.
Can someone please tell me how I can get a reference to an html element inside a modal via an id. I already tried angular.element(document.getElementById(“foo”)) which does nothing but return an empty array.