Ionic 2 Tabs Template with TypeScript
Note. This template is based on Ionic 2 Beta 10.
A template to create Ionic 2 apps with Visual Studio tools for Apache Cordova using TypeScript
Table of Contents
Visual Studio Requirements
- A recent version of Node/NPM
- A global installed version of Cordova,Ionic, and TypeScript npm packages:
npm i -g cordova ionic@beta typescript
Once you have your first project based on this template/repo created, you should follow the next steps:
Restore Npm Packages
VSCode will depend on you to execute
npm install from the root folder.
Visual Studio should start the restore process as soon the project is opened, you should see how the Dependencies node in Solution Explorer shows a message saying "Restoring..",
you can always invoke the restore process manually with
To verify that the packages are completely restored you can check that the folder
www\build contains some folders.
Note. Visual Studio shows the restore log in the Output Window
Ctrl+Alt+Ounder the Npm/Bower category.
Run Gulp Tasks
Visual Studio 2015 includes a Task Runner Explorer that will show you all the available tasks to execute from the UI.
You can access the Task Runner Explorer from the Menu:
View->Other Windows-Task Runner Explorer or with the shortcut
Note: To ensure that the default tasks are executed before the VS build, we configured the Task Runner Explorer binding the default task to the BeforeBuild event, however you can customize this setting to match your needs (e.g. Binding watch to project opened)
To execute this tasks from the CLI you can:
- Have a global installation of gulp, and run
- Use the local installed version
- Use the npm script:
npm run build
Note: If VS is unable to show the tasks, you can check the log in the Ouput window under the Task Runner Explorer Logs category.
Usual Cordova development Workflow
Once you have all the packages restored, and the Gulp tasks executed, you can use your favorite cordova workflow:
Ionic cli offers the
ionic serve command to implement a Live Reload development workflow, you can obtain similar results executing the gulp task
and using the Live Reload capabilities of the Ripple Emulator