How to attach event handler for nav bar buttons inside ion-nav-bar


I’m new to Ionic and building a tabs-view app which has a nav bar button inside ion-nav-bar element so the nav bar button appears in each tab. The code looks like this.

 <ion-nav-buttons side="right">
  <button id='take-photo' class="button ion-camera" ng-click='takePhoto()'>
My question is where to put the takePhoto function since it does not belong to any tab's controller? Thanks!