I have a question. I am using angular on a page on my PC. There is a question page called question/[qid]. How can I easily get this qid in angular’s js?
The content of the question is loaded in php, only the answers, comments and other content are obtained from angular, and are loaded with the page at the beginning.
But when I get answers and comments through $http, I need to pass the qid parameter, so I have to find a way to get the value of qid.
I would like to know if there is a corresponding solution in angular.
Since your backend is PHP, it is the simplest way to directly load data and render HTML in the backend.
If you still want to get the URL, you can use
To get the current URL address
Get the last id through regular expression