javascript - What is the prefered way of simulating ui-sref from ng-swipe event? -
javascript - What is the prefered way of simulating ui-sref from ng-swipe event? -
state alter on swipe: i need trigger state alter using swipe event. ui-router docs lead em $state.go()
i'm not sure if best method?
using ng-swipe
events how trigger $state.go()
params?? or there improve approach scenario?
i have state called:
name: 'root.store.ad.page.pagenumber', 'url': '/:pagenumber'
on swipe of li
ideally this(doesn't have to):
<li ng-swipe-left="root.store.ad.page.pagenumber({pagenumber: nextpage})"></li>
currently looks :
<li ng-swipe-right="setpage(page.pageindex)"></li>
i've tried $state.go() i'm having problem making work params?
error:
ctrl:
scope.setpage = function(val){ //trying create jump page 5. $state.go('root.store.ad.page.pagenumber', { pagenumber: 5, } ); };
per comments, changing
name: 'root.store.ad.page.pagenumber', 'url': '/:pagenumber'
to
name: 'root.store.ad.page.pagenumber', 'url': '/{pagenumber}'
worked
javascript angularjs angular-ui-router ui-sref
Comments
Post a Comment