mardi 29 mars 2016

angularsjs state provider multi params

I am trying to build state provider that catch multi params but the issue is that i dont know how many params is it possible to catch them as object or array? or the only solution is to catch it as string and separate them?

for example this is my provider

.state('app.confirmPayment', {
        url: '/comfirmPayment/:params',
        templateUrl: '/Views/ConfirmPayment.html'
    })

and controller

app.controller('ConfirmController', ['$scope', '$state', 
    function ($scope, $state) {
        var self = this;

        console.log('$state confirm payment');
        console.log($state);
        console.log('$state confirm payment');

    }
]);

and want to catch all the params separated

/comfirmPayment/:age=15&name=erez.....  // can be more that i dont know

and can be more params that i dont know what they can be

thanks hope its clear




Aucun commentaire:

Enregistrer un commentaire