Redirecting to another page and passing in values
<p>I want to redirect to another page while passing in the id parameter, how do I do that? This is my code which I tried after searching for examples. I already created a visit form where I can pass in all the visit information. After that I'll displaying the visit information and have a button to click to redirect me to a form where I create trips. I want to get the id of the visit to create trips according to the visit that they clicked on. I have added photos of the ui to make it more understandable.</p>

<p><a href="https://i.stack.imgur.com/6sh6I.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6sh6I.png" alt="Create Trip Page"></a> <a href="https://i.stack.imgur.com/IkeaM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IkeaM.png" alt="Create Visit Page"></a> <a href="https://i.stack.imgur.com/oZgIq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oZgIq.png" alt="View Visit Page"></a></p>

<p>Codes I added in my html page </p>

<pre><code>&lt;button ng-click="redirect()"&gt;Start Planning trips!&lt;/button&gt;
</code></pre>

<p>Codes in my controller</p>

<pre><code>$scope.redirect = function(){
$location.path('#/create-trip').search('id=' + $scope.visit.id); }
</code></pre>