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?

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

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

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

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

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

Error: [$compile:ctreq] Controller ‘ionTabs’, required by directive ‘ngClass’, can’t be found!$compile/ctreq?p0=ionTabs&p1=ngClass
at getControllers (
at Array.forEach (native)
at forEach (
at getControllers (
at nodeLinkFn (
at compositeLinkFn (
at publicLinkFn (
at link (

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 = function(tab) {
$scope.activeTab = tab;

The post might help you with this: