ionic-native-transitions icon indicating copy to clipboard operation
ionic-native-transitions copied to clipboard

StateParams with native-ui-sref

Open vandervidi opened this issue 9 years ago • 9 comments

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?

vandervidi avatar Nov 18 '15 10:11 vandervidi

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

shprink avatar Nov 18 '15 14:11 shprink

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 ?

iamsamwood avatar Jan 11 '16 07:01 iamsamwood

$ionicNativeTransitions.stateGo('yourState', <stateParams>) same as $state.go('yourState', <stateParams>)

shprink avatar Jan 11 '16 14:01 shprink

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

iamsamwood avatar Jan 12 '16 22:01 iamsamwood

You are right. My mistake!

shprink avatar Jan 12 '16 22:01 shprink

@iamsamwood please try rc8

the api changed to: https://github.com/shprink/ionic-native-transitions#state

shprink avatar Jan 12 '16 23:01 shprink

@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

iamsamwood avatar Jan 13 '16 07:01 iamsamwood

Once again you are right!

shprink avatar Jan 13 '16 16:01 shprink

Fixed in v1.0.0-rc9

shprink avatar Jan 17 '16 20:01 shprink