Junaid Syed

Junaid Syed

  • NA
  • 485
  • 130.6k

How can i redirect to other page using angularjs

Nov 2 2017 2:48 AM
Hi iam using angularjs1 when im trying to redirect my page to another page using "ng-click"
its not getting redirected.My code is some thing like this.
  1.   <input type="submit" ng-click="clicked()" value="Addstudent" />  
  2.   
  3. SCRIPT:  
  4. $scope.clicked = function () {  
  5.         $location.path("/AngularProject/Addstudent");  
  6.     } 
when i click Addstudent button my url is changing to some thing like this.
  1. http://localhost:56120/#!/AngularProject/Addstudent 
 iam getting extra signs "#!" in my url.if i remove that sign from url its' getting redirect to destination page.
 
 which is the better way to reditect the page $location.path or $windows.location.
please help me out...Thank you.
 
 

Answers (2)