I am new to angularjs so I may be taking the wrong approach but here is my situation. I have an MVC3 app but I am only using Mvc to serve up a "layout" page and the script and css files. In that view I have a ng-view tag. Here is my routeProvider
$routeProvider.when('/', { templateUrl: '/templates/search.html', controller: 'SearchController' }).
when('/Search', { templateUrl: '/templates/searchResults.html', controller: 'SearchController' });
So initially the search.html template is going to load which is nothing but a form and Search button. The user enters whatever form data they want to search by and click "Search" which is tied to a function $scope.search that gets the form data and call WebApi to get the results. The function returns a promise, and .then I want to assign the results to the $scope and then load the searchResults.html template by calling $location.path("/Search"); The problem is when that is called it reloads the controller and the $scope is wiped out.
I want to do this without using the MVC framework. I know angular takes a new way of thinking and I think my problem lies there. Can anyone guide me to where I should be going with this?