I'm building a Ionic application with angular.js, I'm almost done, but now I have a minor trouble. 

In my `templates/menu.html` I have:

```
<ion-item nav-clear menu-close ng-click="filterByPeriod(weekBegin, currentDate)">Filter  </ion-item>

```

and my controller.js:

```
.controller('Home', ['$scope', '$ionicModal', '$cordovaGeolocation', function($scope, $ionicModal, $cordovaGeolocation) {
  App = {
    init: function() {
      setTimeout(function(){
        $scope.map = new google.maps.Map(document.getElementById("map-canvas"), mapOptions);
      }, 200);
    },
  };
  $scope.addMarkersToMap = function(reports, map) {
    var newCenter = new google.maps.LatLng(reports[0].latitude, reports[0].longitude);

    map.setCenter(newCenter);
    map.setZoom(12);
  }

  $scope.filterByPeriod = function(beginDate, endDate) {
    var cityId = window.localStorage.getItem('cityId');

    serviceReports.getDenunciasFromPeriod(cityId, beginDate, endDate)
    .success(function(reports){
      $scope.addMarkersToMap(reports.dados, $scope.map);
    });
  }
  App.init();
}]);

```

I already try do this with a `$scope.apply(function(){}) that encapsulates this method but with both ways I'm catching this error:

<http://cl.ly/image/200O1d2F1C46>

Anyone have any idea how to solve this problem?