Close panel from link in listview

I have a jquery mobile page which has a panel. Inside the panel I have a listview, and on each listitem there is a where I've added a data-rel="close" attribute. I want to be able to close the panel when ever a listitem is clicked.

Note that I also has a binding to angular.

<ul data-role="listview" data-icon="arrow-l" class="ui-icon-alt" data-inset="true" >
        <li ng-repeat="task in tasks" >                                
            <a href="#" ng-click="selectTask(task)" data-rel="close">{{task.Name}}</a>                        
        </li>            
    </ul>

I've testes on a link outside the listview and it works fine. I'm not sure id angularjs is playing a trick on me here or it is something else.

best regards Rasmus

Markup

<a href="#" id="closepanel" ng-click="selectTask(task)" data-rel="close">{{task.Name}}</a>

JS

$('#closepanel').on('click', function {} {
 $( "#PanelID" ).panel( "close" );
});