Ng- click in <ion-tabs>

I have five tabs.
I want to call a javascript(AngularJS) function when I click on a tab, but the console say to me that ng-click directive require a controller named ‘tabs’.
Alternative ways to call this function?
Source:

 <ion-tabs class="tabs-positive tabs-top">

<ion-tab title="DAY 1" icon-off="ion-ios7-filing-outline" ng-click="dailyNews(1)">
    <ion-nav-view name="Day1"></ion-nav-view>
</ion-tab>

<ion-tab title="DAY 2" icon-off="ion-ios7-clock-outline" ng-click="dailyNews(2)">
    <ion-nav-view name="Day2"></ion-nav-view>
</ion-tab>

<ion-tab title="DAY 3" icon-off="ion-ios7-gear-outline" ng-click="dailyNews(3)">
    <ion-nav-view name="Day3"></ion-nav-view>
</ion-tab>

<ion-tab title="DAY 4" icon-off="ion-ios7-gear-outline" ng-click="dailyNews(4)">
    <ion-nav-view name="Day4"></ion-nav-view>
</ion-tab>

<ion-tab title="DAY 5" icon-off="ion-ios7-gear-outline" ng-click="dailyNews(5)">
    <ion-nav-view name="Day5"></ion-nav-view>
</ion-tab>
</ion-tabs>

You can use “on-select” per the ion-tab docs:

http://ionicframework.com/docs/api/directive/ionTab/

I tried your method, but the console changed the message in :

Error: [$compile:ctreq] Controller ‘ionTabs’, required by directive ‘ngClass’, can’t be found!
http://errors.angularjs.org/1.2.6/$compile/ctreq?p0=ionTabs&p1=ngClass
at http://127.0.0.1:8662/myApp/www/lib/angular/angular.js:78:12
at getControllers (http://127.0.0.1:8662/myApp/www/lib/angular/angular.js:6042:19)
at http://127.0.0.1:8662/myApp/www/lib/angular/angular.js:6050:24
at Array.forEach (native)
at forEach (http://127.0.0.1:8662/myApp/www/lib/angular/angular.js:302:11)
at getControllers (http://127.0.0.1:8662/myApp/www/lib/angular/angular.js:6049:11)
at nodeLinkFn (http://127.0.0.1:8662/myApp/www/lib/angular/angular.js:6213:35)
at compositeLinkFn (http://127.0.0.1:8662/myApp/www/lib/angular/angular.js:5622:15)
at publicLinkFn (http://127.0.0.1:8662/myApp/www/lib/angular/angular.js:5527:30)
at link (http://127.0.0.1:8662/myApp/www/lib/ionic/js/ionic.bundle.js:44053:61)

Pay Attention: I haven’t used ng-class in this template but on-select directive require it(I think).

I solved this issue programatically. I used still ng-click and a function to change tab before making a Query, so this method works correctly. However, the message above is there again(I concluded it’s a ‘warning’ advice).

$scope.dailyNews = function(tab) {
$scope.changeTab(tab);

}

$scope.changeTab = function(tab) {
$scope.activeTab = tab;
$ionicTabsDelegate.select($scope.activeTab);
}

The post might help you with this:

http://www.yourtechchick.com/angularjs/ionic/how-to-call-a-function-on-click-in-ion-tabs/