javapadawan
javapadawan

Reputation: 907

Polymer Dart - Multiple View

I'm trying to create a sample CRUD application using Dart and Polymers.

One think I noticed is almost all dart polymer examples have only one page. I'm trying to look for samples with multiple pages.

i.e.

This is very doable using only one screen, but am looking for a best practice in implementing multiple screens. In GWT it uses the Activities and Places. What is the dart counter part?

I saw on some other post using routes, but seems does not work on my Dart Editor. And I am not sure if this is still current as that posted almost a year now.

Route Example

 ShadowRoot.resetStyleInheritance and ShadowRoot.applyAuthorStyles now deprecated in dart:html.
 Please remove them from your code.

 Uncaught Error: Illegal argument(s): No handler found for /routes_example.html#one
 Stack Trace: 

Upvotes: 2

Views: 538

Answers (1)

Günter Zöchbauer
Günter Zöchbauer

Reputation: 657058

I just published a package for routing with Polymer (see https://github.com/bwu-dart/bwu_polymer_routing) There are two links to simple demos available online. I have a SDK dependency on 1.6.0 (dev-channel release) because I haven't tested it with Dart 1.5.x. I might remove this restriction with the next release.

Some highlights:

  • Hierarchical views are automatically created and inserted depending on the current route.
  • Route parameter values are automatically passed to the view attributes on route or parameter value change.
  • Parameter values are updated in the view without creating the view again.
  • The same code runs no matter if usePushState is enabled or disabled.
  • Mixin with event handlers for simple go-to-route links or buttons.
  • Mixin for adding DI support to your Polymer elements.

see also https://stackoverflow.com/a/25228357/217408

Upvotes: 2

Related Questions