Unable to access html elements in modal from controller



    <div id="foo">Hi

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.