I need to pass a URL parameter to the controller. On the below URL, I need to pass the ID parameter to the controller.
http://localhost/branch/more.php?id=20
Pass the ID URL parameter to the controller that I have given below.
app.controller('customersCtrl', function($scope, $http) {
$http.get("message.php?id=").then(function (response) {
$scope.myData = response.data.message;
});
Inject $routeParams
in your controller like
app.controller('customersCtrl', function($scope,$http,$routeParams) {
var routeID = $routeParams.id;
$http.get("message.php?id="+routeID).then(function (response)