通过本文主要向大家介绍了老生常谈,老生常谈的意思,老生常谈是什么意思,老生常谈的近义词,老生常谈造句等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
路由是这么定义的:
$stateProvider .state('page1', { url: '/page1', templateUrl: 'views/page1.htm', controller: 'page1Ctrl' }) .state('page2', { url: '/page2/:type', templateUrl: 'views/page2.htm', controller: 'page2Ctrl' });</div>
用ng-href跳转的话,是这么写的:
ng-href="#/page1" rel="external nofollow"
ng-href="#/page2/1" rel="external nofollow"
用$state.go跳转的话,是这么写的:
$state.go("page1");
$state.go("page2",{type:1});
用ui-sref跳转的话,是这么写的:
ui-sref="page1"
ui-sref="page2({type:1})"
可以对照一下
以上这篇老生常谈angularjs中的$state.go就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持。
</div>