I am trying to pass data from $scope.abc() to an actual function.
[Function]
function sweetAlertCtrl($scope, SweetAlert, $state) {
$scope.demo1 = function () {
SweetAlert.swal({
title: "Good job!",
text: "You clicked the button!",
type: "success"
},
function ($state) {
$state.go('pjt.detailed', {id: $scope.id}) // This is where the data from $scope is received.
});
}
}
[Data from $scope]
$scope.demo1($scope.id);
How can I pass $scope.id to demo1() function? Did I even put the $state in the correct location? I am new to this and this is really confusing :)
Please advise me what I should do.
Thank you so much in advance!!