Reputation: 1322
I really like what I'm seeing with Web components in Dart. I had a look at the web page containing the different examples and would love to try it out.
If however I try any of the Samples on the page (like the helloworld example), by just pasting it in my dart editor, it just doesn't work. The TodoMVC app works, but it seems quite messy with all of those files just to run a one page app, and while serves as a good example of a fully working app, it's not a good starting point to learn.
Being a newbie in dart it's not very clear how I can start to use Web Components myself. What would be nice is if there was a very simple tutorial on the Web Components page, that shows you how to start from scratch to create a very simple app using web components.
Even the Hello World app would be good for this purpose.
Does someone have a good example of how to start with web components in dart?
Upvotes: 2
Views: 4143
Reputation: 14191
I wrote a tutorial on getting started with web components using the Dart Web UI library. It is fairly basic and is a good place to start if you don't have much prior experience with web components. The tutorial can be read at:
http://shailen.github.com/blog/2012/12/31/a-first-app-with-web-components-using-dart/
The code, which you should download and run, lives at:
https://github.com/shailen/bookstore
Hope this helps.
Upvotes: 1
Reputation: 5030
Did you read: http://www.dartlang.org/articles/dart-web-components/
See also: http://www.dartlang.org/articles/dart-web-components/tools.html
You can find the sample code here: https://github.com/dart-lang/dart-web-components
Updated: Seth wrote a nice blog post here: http://blog.sethladd.com/2012/11/your-first-web-component-with-dart.html
Upvotes: 2
Reputation: 2086
I think your missing link is build.dart. See the section labeled "Editor background compilation" at http://www.dartlang.org/articles/dart-web-components/tools.html. As noted on that page, there are a few options to compile your Web Components, but I found build.dart the most straightforward.
This build.dart script interacts with some SDK components, so you'll want to be sure you've added the path to your system. On my OS X machine, I added this to my ~/.profile file:
export PATH=$PATH:/Users/dave/dart/bin
HTH!
Upvotes: 1