dart-polymer

import polymer core-scaffold breaks google maps

Deadly 提交于 2020-01-15 12:56:49
问题 I have some working dart polymer code that shows a google map with some markers on it. It took me a while to get those to show up, as it seems the initialization routines are a bit wonky and it's as if sometimes there is not enough time to load the map div before it tries to render. Anyway, as I said I got that working. Now I wanted to put a core-scaffold around it, as they do on many demos. The minute I add this line... <link rel="import" href="packages/core_elements/core_scaffold.html"> ..

Can't get Library in Dart to work properly

血红的双手。 提交于 2020-01-15 12:43:57
问题 I have some files and I want them in one library. But it just doesnt work or throws Exceptions. Let's say I have these files. Lib.dart, 1.dart, 2.dart, 3.dart and for each of them also an html file, which defines the polymer element. // Lib.dart library testLib; import 'dart:html'; part '1.dart'; part '2.dart'; part '3.dart'; /* ... Code ... */ and // 1.dart 2.dart and 3.dart part of testLib; /* ... Code ... */ It didnt work and i got the message: 'http://localhost:8080/1.dart': error: line 7

Can't get Library in Dart to work properly

若如初见. 提交于 2020-01-15 12:43:07
问题 I have some files and I want them in one library. But it just doesnt work or throws Exceptions. Let's say I have these files. Lib.dart, 1.dart, 2.dart, 3.dart and for each of them also an html file, which defines the polymer element. // Lib.dart library testLib; import 'dart:html'; part '1.dart'; part '2.dart'; part '3.dart'; /* ... Code ... */ and // 1.dart 2.dart and 3.dart part of testLib; /* ... Code ... */ It didnt work and i got the message: 'http://localhost:8080/1.dart': error: line 7

Can't get Library in Dart to work properly

放肆的年华 提交于 2020-01-15 12:43:04
问题 I have some files and I want them in one library. But it just doesnt work or throws Exceptions. Let's say I have these files. Lib.dart, 1.dart, 2.dart, 3.dart and for each of them also an html file, which defines the polymer element. // Lib.dart library testLib; import 'dart:html'; part '1.dart'; part '2.dart'; part '3.dart'; /* ... Code ... */ and // 1.dart 2.dart and 3.dart part of testLib; /* ... Code ... */ It didnt work and i got the message: 'http://localhost:8080/1.dart': error: line 7

How can I access DOM elements in Polymer elements from a global namespace?

半城伤御伤魂 提交于 2020-01-15 11:13:28
问题 I want to access a DOM element that's in my-app-as-an-element.html from my app.dart global (because it's a method I want to call from several places, e.g. it changes the page title), but as it's wrapped in shadows and all, I can't seem to get at it. There's a trick to do e.g. HtmlElement el; el = document.querySelector('body /deep/ #page-title'); But /deep/ isn't respected in Safari, so that's off the table. Ideas? 回答1: What you are trying to do goes directly against the philosophy of Polymer

Is it possible to use an Angular 2 Dart frontend with a Node.js backend?

匆匆过客 提交于 2020-01-06 20:13:36
问题 I am planning out the tools I will use in my web app. I would like to use Node.js as a server backend because it has a module that would be particularly useful to me. However, I would also like to use Angular 2 (Dart) with Polymer.dart in the frontend. Excuse me if the answer should be obvious, but how will it work to combine these two parts of my app seamlessly (and without conversion tools), as is commonly done in the MEAN stack, since Dart is not directly compatible with JS? There aren't

The null object does not have a method []=

狂风中的少年 提交于 2020-01-06 03:24:08
问题 I'm trying to run this following example minus some differences in pubspect.yaml since it doesn't run out of the box. Namely reflections needs to be 0.2.0 instead of 0.1.4 as seen on the example link. Everything compiles fine. However I get a runtime error. I traced it to the following file: https://github.com/dart-lang/polymer-dart/blob/behaviors/lib/init.dart On line 25 I get the following error in the Dartium browser: The null object does not have a method '[]='. NoSuchMethodError: method

core-list-dart template how to bind to the model itself

為{幸葍}努か 提交于 2020-01-05 03:51:19
问题 I'm using the <core-list-dart> element in my Polymer Dart application: <core-list-dart data="{{data}}"> <template> <span>{{name}}</span> </template> </core-list-dart> Data is an array of Foo where Foo is: class Foo { String name; ... } It is possible in the template refer to the Foo instance instead of his fields? Something like: <core-list-dart data="{{data}}"> <template> <foo-element foo="{{ITEM}}"></foo-element> </template> </core-list-dart> 回答1: From version 0.4.0 of core_elements the

Switching content when tab selected using polymer ui elements tabs

余生长醉 提交于 2020-01-03 13:31:44
问题 I'm trying to use the polymer-ui-tabs component for a traditional tab component where you switch content based on which tab is selected. Unless I'm missing something the polymer-ui-tabs component only seems to provide the tab selector bit without an in built mechanism for switching content. Is that correct? If it doesn't then how do I build that on top of it? The most likely thing I found was onPolymerSelect in polymer_selector but that method currently looks like this Stream<CustomEvent> get

How to create shadow DOM programmatically in Dart?

£可爱£侵袭症+ 提交于 2020-01-02 18:58:19
问题 I'm trying to implement the following JS code in Dart way: Code is taken from here: http://www.html5rocks.com/en/tutorials/webcomponents/shadowdom-201/ <div id="host">Host node</div> <script> var root = document.querySelector('#host').createShadowRoot(); root.innerHTML = '<style>' + 'button {' + 'color: green;' + '}' + '</style>' + '<content></content>'; </script> I have no doubt that in JS it works ok, but in Dart it fails. As we know the only one dart script per document is allowed, so I