dart-polymer

In Polymer.js children of a template have a reference to the template, how can this be done in Polymer.dart

泪湿孤枕 提交于 2019-12-17 16:36:00
问题 When I have a reference to an element that was produced by a <template> , in Polymer.js such elements have an attribute templateInstance that provides a references to its template like it's used here: https://github.com/PolymerLabs/polymer-selector/blob/master/polymer-selector.html#L286 回答1: Polymer >= 1.0.0 @reflectable void someClickHandler(dom.Event event, [_]) { // for native events (like on-click) var model = new DomRepeatModel.fromEvent(event); // or for custom events (like on-tap,

Passing values from login form to dashboard

守給你的承諾、 提交于 2019-12-14 03:58:48
问题 What would be the best way to retrieve the Username entered on a login form in dart polymer to be read in the next page to which it is redirected? The login component is as below - @CustomTag('alfresco-login-form') class LoginFormComponent extends FormElement with Polymer, Observable { LoginFormComponent.created() : super.created(); @observable String username = ""; @observable String password = ""; @observable Map loginData = toObservable({ 'username' : '', 'password' : '' }); @observable

Data binding fails with Dart

╄→尐↘猪︶ㄣ 提交于 2019-12-14 03:44:03
问题 I am trying some beginner tutorials to understand data binding with Dart-Polymer, but none of the examples are working. I am able to run the samples included in the project, so wonder what's wrong with my code. From the following link, here is my code : <!DOCTYPE html> <html> <head> <script src="packages/web_components/dart_support.js"></script> <!-- <script src="packages/web_components/platform.js"></script> not necessary anymore with Polymer >= 0.14.0 --> <script async src="packages/browser

Polymer events from distant nodes

我怕爱的太早我们不能终老 提交于 2019-12-14 01:27:04
问题 I'm trying to get familiar with polymer, and have been working my way through trying to build a sample application with it. Following the tutorials at https://www.dartlang.org/docs/tutorials/polymer-intro and reading other StackOverflow questions such as How do I fire a custom event from Polymer Dart? I have managed to build two elements where one element fires an event that is acted upon by the second element. I have, however, only been able to figure out how to do this for cases where the

Module.DEFAULT_REFLECTOR not initialized

心不动则不痛 提交于 2019-12-13 18:26:09
问题 I'm setting up an AngularDart/PolymerDart project, but I keep running against the following error: Breaking on exception: Module.DEFAULT_REFLECTOR not initialized for dependency injection. http://goo.gl/XFXx9G Now I've read the page behind the url given at the end of the error and did some Stackoverflowing, but the only sollution I came across was adding -angular as a transformer in the pubspect.yaml. And so I did. But still I keep getting the same error and my project won't start. My pubspec

Why does DART make my site SOOOOO slow?

我的梦境 提交于 2019-12-13 17:54:19
问题 collegues! I have been working in this website ( www.2winbet.gr ). This week added a login interface from the website that was build as a small plugin in Dart using polymer . It all "works" , and I am pretty happy with the speed I managed to build this component in Dart... BUT.... the site became HYPER slow after I added it!!... If I remove it, the site is super fast again... My dart code is so small and simple... I can really not understand where the issue is... Could you please point me out

Dart Polymer 1.0 - Two-way binding works?

拈花ヽ惹草 提交于 2019-12-13 16:32:54
问题 Two-way binding works in Dart Polymer 1.0 - RC2? When I change the field @Property(nofity: true) in the .dart, it does not reflect (change) into {{}} in the .html. See the following example. Whem I click on paper-button, it´s fire clicar , the property text is changed, but {{text}} does not change! main_app.html <dom-module id="main-app"> <style> :host { display: block; } </style> <template> <paper-input label="Type something..." value="{{text}}"></paper-input> <p> Text: <span>{{text}}</span>

Bind JSON key value pairs to table template in polymer dart

烂漫一生 提交于 2019-12-13 16:25:54
问题 how I can bind to the key/value pairs within a json object in polymer notation. i have template repeat="{{objects in jsonarray}}"... I want to lay out a table. say each object has {1: one, 2: two, 3: three} something like: <template repeat="{{item in mylist}}"> <tr> <template repeat="{{key, value in item}}"> <td>{{key}}: {{value}}</td> </template> </tr> </template> 回答1: this code works for me: Dart: @observable List jsonlist = toObservable(JSON.decode('[{"1":"one"},{"2":"two"}]')); HTML:

Dart app cannot find index.bootstrap.initialize.dart

让人想犯罪 __ 提交于 2019-12-13 14:05:34
问题 I am uncertain why, on attempting to start my app I get the following errors: debug GET http://localhost:63342/epimss_polymer_app/web/index.bootstrap.initialize.dart pub_serve Build error: Transform Reflectable on epimss_polymer_app|ReflectableTransformed threw error: The null object does not have a getter 'type'. NoSuchMethodError: method not found: 'type' Receiver: null Arguments: [] dart:core-patch/object_patch.dart 42 Object._noSuchMethod dart:core-patch/object_patch.dart 45 Object

How To Initialize Internationalization For A Polymer Element Before It Loads On Page

你说的曾经没有我的故事 提交于 2019-12-13 12:02:08
问题 I am using Dart to build a Polymer app. Since I am using Dart's internationalization capabilities within Polymer elements, I want to initialize internationalization messages before a Polymer element is created and display the appropriate messages for a given locale within the Polymer element. How can this be done? Has anyone successfully used Polymer with Internationalization? ps. I have followed this example to set up internationalization The following is the default generated Polymer app by