I’m using the tabs template, trying to get ng-click on a button to show a ngCordova dialog. I’ve got the plugin installed and working when the controller fires. The button calls my $scope.alert(), but the $cordovadialogs.alert(“wow2!”); is not called because $cordovadialogs is undefined. Why does $scope not know about $cordovadialogs? I’m new to Angular… should this function be defined differently?
Code is as follows:
Send
.controller('FriendDetailCtrl', function ($scope, $stateParams, Friends, $cordovaDialogs) {
$cordovaDialogs.alert('Wow!');
$scope.friend = Friends.get($stateParams.friendId);
$scope.alert = function () {
alert('here');
$cordovadialogs.alert("wow2!");//NOT WORKING
};
})
