After reading various posts on the same subject, I am still struggling to get my own code to work. My goal is to change the location of my app upon a ng-click event. Here is the html code I have:
<button class="button icon-left ion-plus-round button-block button-calm" ng-click="send({{foods.cal}})">
Add Calories
</button>
And this is what my controller looks like:
.controller('foodDetailCtrl', function($scope, $stateParams, $location, foods) {
$scope.foods = foods.get($stateParams.foodsId);
$scope.send = function(i) {
// do something with 'i'
$location.path('/calc');
}
})
However, when I click on the button in my html, the location refreshes to a home tab instead of finding '/calc'. I've attempted different variations, such as adding parent folders or file extensions to 'calc', but nothing seems to work. Any assistance would be greatly appreciated.