How to use view in angular js on other page after $location.path?
<p>This is my app.js</p>

<pre><code>var mainApp = angular.module("myapp", ['ngRoute']);
mainApp.config(['$routeProvider', function($routeProvider) {
$routeProvider.

when('/', {
  templateUrl: '/search/login.html'
}).

when('/dashboard', {
  templateUrl: 'admin/index.html'
}).

otherwise({
  redirectTo: '/'
});

}]);

mainApp.controller('logincntrl',function($scope,$location){
$scope.submit=function(){
  var uname=$scope.username;
  var upass=$scope.password;
  if($scope.username=="admin" &amp;&amp; $scope.password=="admin"){
     $location.path('/dashboard');
  }
 };
 });`
</code></pre>

<p>After clicking on submit.It will redirect to dashboad..That is seperate folder with index.But as i have given view on the first page ..my dashboard contain coming on the first page even with styling..how to make seperate view for dashboard page</p>