Join egghead, unlock knowledge.

Want more egghead?

This lesson is for members. Join us? Get access to all 3,000+ tutorials + a community with expert developers around the world.

Unlock This Lesson
Become a member
to unlock all features

Level Up!

Access all courses & lessons on egghead today and lock-in your price for life.


    Preview an Angular 2 Mobile App with Ionic Lab

    2 - 6

    Ionic’s CSS and JS can detect what platform a user is on, and adjust to make sure you’re getting the correct interface. To preview this locally, you can use the CLI’s --lab flag to see what your app will look like before it’s even deployed to a device.



    Become a Member to view code

    You must be a Pro Member to view code

    Access all courses and lessons, track your progress, gain confidence and expertise.

    Become a Member
    and unlock code for this lesson
    orLog In




    When running in the browser, Ionic defaults to a very material design look and feel. This isn't the only UI mode that Ionic has. To view Ionic's different UI modes, we can use the Ionic Lab command to simulate different platforms.

    We'll open up a new terminal, and run the command "Ionic Lab." This will start up our live reload server, but instead of loading our app, will give a custom page with our app in a device preview. We can load additional platforms by going up to the platforms tab and selecting either Andriod, iOS, or even Windows.

    The differences become more apparent when you look at an app's navigation. When you view Android, the page transitions feel very material design, right at home on the Android platform. For iOS, the pages move left to right, and vice versa when going back, right at home with the iOS design pattern.

    We can see the platform differences extend to UI components as well. Let's modify our sliding items option buttons a bit. We'll notice that the icons will adapt to each of the platforms, making the whole experience of the app that much better.

    These platform differences exist for every component inside Ionic's toolkit. Be sure to check out the documentation, so that way you can see a clear example of all the components and all their different modes.