ionic-native-transitions
ionic-native-transitions copied to clipboard
StateParams with native-ui-sref
Hi When linking another with stateParams, i get an error like: "Could not resolve 'state.name({param1: data1, param2: data2})' from state 'someState'"
The transition works well without the stateParams.
tested it with the ui-router directive ui-sref attribute with stateParams and it works well as expected. Is it possible to pass stateParams using the native-ui-sref directive?
You mya use {inherit:false}
option.
native-ui-sref="tabs.home" native-ui-sref-opts="{inherit:false}"
https://github.com/shprink/ionic-native-transitions#using-directives
or
$ionicNativeTransitions.stateGo('yourState', {inherit:false}, {
"type": "slide",
"direction": "up", // 'left|right|up|down', default 'left' (which is like 'next')
"duration": 1500, // in milliseconds (ms), default 400
});
https://github.com/shprink/ionic-native-transitions#state
I'm hitting this as well--I see state options being passed, but not state params. Is there a way to pass state params with native transitions ?
$ionicNativeTransitions.stateGo('yourState', <stateParams>)
same as $state.go('yourState', <stateParams>)
ui-router $state.go takes 3 arguments, stateName, stateParams, stateOptions [1], but it seems that $ionicNativeTransitions.stateGo only takes stateParams as the second argument, while "native-ui-sref-opts" takes stateOptions. Is this correct? Thanks.
[1] http://angular-ui.github.io/ui-router/site/#/api/ui.router.state.$state#go
You are right. My mistake!
@iamsamwood please try rc8
the api changed to: https://github.com/shprink/ionic-native-transitions#state
@shprink OK thanks. Does ui-sref-opts need to be updated for this change as well ?https://github.com/shprink/ionic-native-transitions/blob/develop/lib/nativeSref.js
Once again you are right!
Fixed in v1.0.0-rc9