Using Mobiscroll with Ionic 2,3,4 and Ionic 5

Installing Mobiscroll in your Ionic app takes a couple of minutes. Let's see how you can start with a simple app. Follow this guide for Ionic 2+. If interested in usage with Ionic 1, continue reading here.

Using the Mobiscroll CLI and NPM to install it in your Ionic app (PREFERRED WAY)

Step 1: Create an app

Assuming you have node and ionic already installed (if not, you can read about it in the Ionic docs), use the CLI to create a new app.
If you already have an app at hand, you can skip this step.

Note that it could take a couple of minutes until the app is created (depending on your internet connection and machine performance).
$ ionic start my-starter-app tabs
$ cd my-starter-app

Step 2: Install the Mobiscroll CLI and configure the app

Install Mobiscroll CLI from NPM (you'll only have to do it once).

$ npm install -g @mobiscroll/cli

Run mobiscroll config ionic in your terminal window with the version flag.

$ mobiscroll config ionic --version=5
In this case, the --version flag refers to the Mobiscroll version.

The command will ask for your credentials (email and password). If you already have a mobiscroll account but you are unsure about the details, you find them on your account page. If you don't have an account yet, you can start a trial in no time following these steps.

Step 3. Importing Mobiscroll to other modules (Optional)

When you have only one module (the app.module.ts), the previous configuration process will add an import for the Mobiscroll module there, otherwise it will ask you to choose the Modules you want to use Mobiscroll in.
If you add more modules later, or decide that you need the mobiscroll components in a module you didn't add in the configuration phase, you can add the imports manually like this:

// ...other imports of your module

import { MbscModule } from '@mobiscroll/angular';

  imports: [
    MbscModule, // <-- added the Mobiscroll Module to the imports
    RouterModule.forChild([{ path: '', component: YourNewPage }])
  declarations: [YourNewPage]
export class YourNewPageModule {}

Step 4: Let's see if Mobiscroll was installed correctly

To test it let's add a simple input to the src/pages/home/home.html. In case of an Ionic 4 and Ionic 5 app you will find the home page here: src/app/home/

        <ion-input [(ngModel)]="myBirthday" mbsc-date></ion-input>

To build the app just run the serve command in the CLI:

$ ionic serve

At this point you have completed the setup. Go build great things!

How to start a trial

First, start a free trial by entering your email address on the Mobiscroll homepage and create your account.

This is how the free trial works:

  1. You can try Mobiscroll for free.
  2. The trial needs an active connection to Mobiscroll servers for validation. Don't worry, the licensed product will work offline with downloadable resource files.
    Read about the differences between trial and licensed products.
  3. You can upgrade to the licensed product at any time during or after your trial.

Enter your first name, set a password and you're ready to go!

At this point you have a running trial. You can use the email address you provided with your password to continue your setup.

Select Ionic 2/3/4/5. Then hit the big blue button.