Book Image

DART Cookbook

By : Ivo Balbaert
Book Image

DART Cookbook

By: Ivo Balbaert

Overview of this book

Table of Contents (18 chapters)
Dart Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Deploying your app


To run in any modern browser, your Angular app has to be compiled to minimal JavaScript. Minimal means tree-shaken (so that unused code is left out) and minified (shortening of names and minimum use of spaces).

But first, test your app in other browsers by performing the following steps:

  1. First, test in your default browser by right-clicking on the startup web page and selecting Run as JavaScript. This will compile to JavaScript and execute the app in the browser, but the compiled code will be kept in memory and not written to disk.

  2. To change browsers, go to the menu-item and navigate to Tools | Preferences | Run | Debug, uncheck Use system default browser, and select the other browser. You can also just start that browser and copy the URL from the app in your default browser.

How to do it...

  1. Include the Angular transformer into the app's pubspec.yaml file:

        transformers:
    - angular
  2. Also, add the js and shadow_dom packages to your pubspec.yaml file.

  3. Add the shadow DOM script...