O'Reilly logo

Dart: Scalable Application Development by Ivo Balbaert, Sergey Akopkokhyants, Davy Mitchell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Setting up an Angular app

This recipe is a preliminary step necessary for every other recipe in this chapter. It shows you how to make the Angular Dart functionality available to your app.

How to do it...

  1. There is no angular template yet in Dart Editor, so start your app from a web application (mobile friendly), and call it, for example, angular_setup. Clear the sample code from the html and dart files.
  2. Add angular to the dependencies in pubspec.yaml. Saving will start the pub get procedure.
  3. Also add js and shadow_dom to pubspec.yaml.
  4. Add the shadow DOM script to the html file:
     <script src="packages/shadow_dom/shadow_dom.min.js"></script>
  5. Also, include the Angular transformer:
    transformers:
    - angular
  6. Provide the ng-app attribute in the <html> element. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required