Angular ui-router submits form and redirects page
<p><strong>Question has been updated according to contributions from users MarkWatson and sdfacre</strong></p>

<p>Upon the click of a button, I want to submit a form and show the results on a different page. However, my code isn't working. </p>

<p>I am using ui-router to change the states:</p>

<pre><code>$stateProvider.state('first', {
    url: '/first',
    templateUrl: '/first.html',
    controller: 'MainCtrl',
}).state('second', {
    url: '/second',
    templateUrl: '/second.html',
    controller: 'MainCtrl',
}) 
</code></pre>

<p>Note that I have already injected state into my controller. Here I also injected state into my submit function:</p>

<pre><code>$scope.submitForm = function() { 
    server.submitForm($scope.input1, $scope.input2)
    .success(function(data) {
        $scope.results = data;
        $state.go('second');
    }).error(function(err) {
        console.log(err);
    });    
};
</code></pre>

<p>HTML form:</p>

<pre><code>&lt;form name = "myform" ng-submit = "submitForm()"&gt;
    ...

    &lt;button type = "submit" ng-click="validationFunction()" class="btn btn-default"&gt;Submit and go to another page&lt;/button&gt;
&lt;/form&gt;
</code></pre>

<p>I do not want to put " $state.go('second'); " into the validationFunction because I only want the redirect to happen if the form is submitted, not when it is validated. </p>

<p>Currently, the data is not showing up on the second page as expected.</p>