I want to update status information for which I need to pass two params one is say school_id and other one is status which may be(approved, pending , declined) depending on the user clicks the button. I have a table like school_info with fields like id school_name status So in my applicationjs I need to pass two params id and status. here is my html code, I have ng-repeat so I am using school in schools.
<a href="#/changeStatus/{{school.id}}/approved"><button class="btn btn-success" ng-model="approve">Approve</button></a>
<a href="#/changeStatus/{{school.id}}/declined"><button class="btn btn-danger" ng-model="decline">Decline</button><a>
<a href="#/changeStatus/{{school.id}}/pending"><button class="btn btn-deafult" ng-model="Pending">Pending</button></a>
my app.js code is
var app=angular.module("admin",[]);
app.config(function ($routeProvider) {
$routeProvider
.when('/', {
templateUrl: 'home.php',
controller: 'adminCtrl'
}).when('/changeStatus/:id/:sts',{
templateUrl:'home.php',
controller:'adminCtrl'
}).when('/Mapview/:id',{
templateUrl:'mapview.html',
controller:'MapCtrl'
}).otherwise({
redirectTo: "/"
});
});
app.controller("adminCtrl",function($scope,$http,$routeParams){
var sts=$routeParams.status;
var id=$routeParams.id;
console.log("sts"+sts+id);
//here I want two params to be fetched inside console log. when clicked on specific btn.I have seen previous questions asked on multiple params passing but there must be easy way out to get multiple params.
});