Can I still use a classic hyperlink (separate html files) to split my app?


#1

I have an app with a signup+login form which are simple views, but after logging in, I want to show a more complex app with tabbed navigation and complex views.

To start, I have set up my app with two separate .html files, “index.html” and “app.html” where the index.html contains the views for signup+registration flow and the app.html contains the tabbed navigation and all other views.

Should I combine all views into one html file (with partials) or is the way I’m doing things ok in ionic?


#2

If your making an mobile app, you really don’t want to break that single-page-app experience. Using classic links would break that :smile: So you may want to figure our a way to incorporate that page into your app


#3

Hi jorre,

I’m quite new to ionic, just testing it but regarding your question this can be achieved in many ways.
See: https://docs.angularjs.org/tutorial/step_07

But you can try adding a new state (I’m assuming you are working from a base template) to your app config.

.config(function($stateProvider, $urlRouterProvider) {  
 $stateProvider
 .state('login', {
   url: '/login',
   templateUrl: "templates/login.html"

})
.state('app', {
  url: "/app",
  abstract: true,
  templateUrl: "templates/menu.html",
  controller: 'AppCtrl'
})

.state('app.track', {
  url: "/track",
  views: {
    'menuContent' :{
      templateUrl: "templates/track.html",
      controller: 'TrackCtrl'
    }
  }
})

then you will just need to handle a redirection to your main app state.

Hope it helps.

\BR


#4

Ok guys, thanks for the input. I solved it by using multiple abstract states