Redirect to new Page in AngularJS using $location

前端 未结 6 1378
庸人自扰
庸人自扰 2020-12-01 01:46

I am testing with the following AngularJS $location. I don\'t what\'s the problem with this. Just want to check if the redirection is working or not:

HTML

6条回答
  •  臣服心动
    2020-12-01 02:39

    this worked for me inside a directive and works without refreshing the baseurl (just adds the endpoint).Good for Single Page Apps with routing mechanism.

      $(location).attr('href', 'http://localhost:10005/#/endpoint') 
    

提交回复
热议问题