Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Learning Dart
  • Table Of Contents Toc
  • Feedback & Rating feedback
Learning Dart

Learning Dart

4.4 (10)
close
close
Learning Dart

Learning Dart

4.4 (10)

Overview of this book

Mastering Dart by Projects is a step-by-step guide that aims to give you hands-on knowledge about programming in Dart using an example-based approach.If you want to become a web developer, or perhaps you already are a web developer but you want to add Dart to your tool belt, then this book is for you. This book assumes that you have at least some knowledge of HTML and how web applications work. Some previous programming experience, preferably in a modern language like C#, Java, Python, Ruby, or JavaScript, will also give you a head start. You can also work with Dart on your preferred platform, be it Linux, Mac OS X, or Windows.
Table of Contents (14 chapters)
close
close
13
Index

Web components with Polymer.dart


The Polymer.dart framework provides a set of Polymer (UI and other) components, but it will only work in the most recent versions of browsers: IE9, IE10, Safari 6, Firefox, and the latest Chrome (also for Android). It is important that in Polymer you can only have a single Dart script tag on an HTML document. Get started with creating a new Polymer application polymer1 by selecting the project template Web application (using the polymer library) in Dart Editor:

A new Polymer application

Inspecting pubspec.yaml will reveal the polymer dependency:

dependencies:
  polymer: any

Pub is invoked automatically, and installs polymer and a whole group of packages needed by polymer (such as mdv, observe, polymer_expressions, shadow_dom, and so on). We'll now examine in detail how a web component is defined in Polymer.

Declaring and instantiating a web component

This is what we see when polymer1.html file is run: again a counter button, defined as a web component (also called...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech

Create a Note

Modal Close icon
You need to login to use this feature.
notes
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Delete Note

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Edit Note

Modal Close icon
Write a note (max 255 characters)
Cancel
Update Note

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY