I have index.html file which have these following below codes. I want to show result to other view searchResult.html when submitting the form. I retrieve the form data in homeCtrl but i can't do when submitting the form show the retrieved data to searchResult.html page. Please help me.
<!DOCTYPE html>
<html ng-app="myApp">
<head>
//head code...
</head>
<body ng-controller="homeCtrl">
<form ng-submit="doSearch()">
<input type="search" placeholder="From" ng-model="search.from">
<input type="search" placeholder="Destination" ng-model="search.to">
<button type="submit">Search</button>
</form>
<div ng-view></div>
</body>
</html>
var app = angular.module('myApp', [])
app.controller('homeCtrl', function($scope, $location) {
$scope.doSearch = function() {
$scope.search={};
$scope.search=$scope.search;
//retrieved data here
}
});