angular.js - angularjs如何通过点击事件来实现路由切换视图?
淡淡烟草味
淡淡烟草味 2017-05-15 16:57:13
0
2
520

页面使用了angular的路由来切换不同的页面视图,如果不使用a标签来切换的话,使用ng-click先触发一些方法判断,然后再启动路由切换视图。这样的方式可以实现的吗?如果可以要怎么样才写语句?网上找了都没找到有靠谱的案例,麻烦各位解答一下疑惑。

淡淡烟草味
淡淡烟草味

reply all(2)
某草草

If you use ngRouter, use $location.path to switch.
If you use uiRouter, you can use state.go

I’m here for Amway uiRouter

洪涛

It is also possible to change the current loaction through ng-click

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!