Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70747

Ionic 4: Add page that I can set as root OR load as a modal

$
0
0

@daveshirmancandc wrote:

I’m not understanding something about routing/lazy loading in Ionic 4, as I’m used to Ionic 3.

I am trying to add an Intro page that I can load either as:

  • the root page on first app load.
  • OR as a modal opened over another page…

So I’ve got two pages so far:

  • Home
  • Intro

Q) How to I set up the pages themselves + app.module etc?

I’ve added the pages using the CLI like:

ionic g page /pages/home
ionic g page /pages/intro

Please can someone explain what I’m doing wrong? My two pages are decorated like this:

@Component({
  selector: 'app-intro',
  templateUrl: './intro.page.html',
  styleUrls: ['./intro.page.scss']
})
export class IntroPage implements OnInit {

and:

@Component({
  selector: 'app-home',
  templateUrl: './home.page.html',
  styleUrls: ['./home.page.scss']
})

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70747

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>