DylanSt
DylanSt

Reputation: 29

Go to another page in ionic

I started my ionic project, but my main problem is going to another page. I couldn't do this process. I need some basic examples or basic tutorials. Thank your already for your answers.

Upvotes: 0

Views: 58

Answers (1)

Gene
Gene

Reputation: 2218

In your controller, declare '$state' like this

.controller('YourControllerName', function($state, ...

To navigate to different UI, use $state.go like this

$state.go('tab.main');

P.S: U will have to follow your app.js naming convention for the navigation. (for mine would be tab.main) :

//Sample app.js 
.state('tab.main', {
    url: '/main',
    views: {
        'tab-main': {
            templateUrl: 'templates/tab-main.html',
            controller: 'MainCtrl'
        }
    }
})

Upvotes: 1

Related Questions