dart-polymer

Getting the value of a paper-radio-button

ぃ、小莉子 提交于 2019-12-10 16:54:48
问题 I have the following code <paper-radio-group id="marital-status-group" on-change={{changeHandler}}> <paper-radio-button name='Married' label='Married'></paper-radio-button><br> <paper-radio-button name='Divorced' label='Divorced'></paper-radio-button><br> <paper-radio-button name='Single' label='Single'></paper-radio-button><br> <paper-radio-button name='Visiting' label='Visiting'></paper-radio-button> </paper-radio-group> void changeHandler( CustomEvent e ) { print ( ( e.target as

How do I get neon-animation to work in Polymer Dart 1.0

谁都会走 提交于 2019-12-10 16:46:31
问题 I have neon-animated-pages working with limited success. I can get it to animate using it's attributes entry-animation and exit-animation. This is great, but I've only been able to get it running with one animation routine for entry and one for exit like so <neon-animated-pages class="waterfront" selected="{{ selected }}" entry-animation="slide-down-animation" exit-animation="slide-right-animation" > .... </neon-animated-pages> and have the selected variable change to enact the animation. I

What are dart polymer transformer entry_points actually for?

浪尽此生 提交于 2019-12-10 16:31:12
问题 Dart apps using polymer.dart have their pubspec.yaml file looking like this (from the Polymer.dart Code Lab): name: polymer_and_dart description: Sample app built with the polymer.dart package environment: sdk: '>=1.2.0 <2.0.0' dependencies: polymer: '>=0.12.0 <0.13.0' dev_dependencies: unittest: '>=0.10.0 <0.11.0' transformers: - polymer: entry_points: - web/begin/index.html - web/end/index.html What do the entry_points actually mean? What does declaring an entry point actually do? 回答1: This

dart-polymer: cannot set an attribute from an event handler

若如初见. 提交于 2019-12-10 14:49:52
问题 The following code doesn't work. Maybe I do something wrong.. Please correct my code: index.html: <html> <head> <title>Page</title> <link rel="import" href="msg_box.html"> </head> <body> <msg-box id="msg" caption="Caption 1"></msg-box> <button id="btn">click me</button> <script type="application/dart" src="index.dart"></script> <script src="packages/browser/dart.js"></script> </body> </html> import 'dart:html'; import 'package:polymer/polymer.dart'; import 'msg_box.dart'; void main() {

Getting HTML5 to work in Form with multiple polymer-dart components

混江龙づ霸主 提交于 2019-12-10 11:36:25
问题 I was reading Seth Ladd's blog at http://blog.sethladd.com/2013/09/forms-http-servers-and-polymer-with-dart.html Lets say I add another Form component (Form2) repeating Steps 3 and 4, and then import Form2 in Step 5. So Step 5 should look like the code below: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Sample app</title> <link rel="stylesheet" href="parse_form_submit.css"> <link rel="import" href="person_form.html"> <script src="packages/polymer/boot.js"></script> </head>

How to replace deprectaed notifyProperty?

假装没事ソ 提交于 2019-12-10 11:14:35
问题 Currently I have a getter xyz that is computed. To schedule a new computation I call notifyProperty(this, #xyz); . In the the latest version of observe , notifyProperty is deprecated. How can I replace it? The documentation suggests to use this.notifyPropertyChange(#xyz, oldValue, newValue); . The problem is, that I don't have the oldValue (and not directly the newValue ) as the getter is computed. 回答1: The suggestion from the devs is to keep the oldValue around in a private variable for

How to use javascript from Dart inside a polymer element

蹲街弑〆低调 提交于 2019-12-10 11:12:54
问题 I am trying to modify sample-google-maps to work inside a polymer element. On running following code I don't see anything except the title and there are no errors.Please advise how can I make this work. In longer run I want to define additional components using google-chart api and Polymer dart. Can someone point me to a worked out example. index.html <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>DEMO</title>

Prevent paper-dialog from automatically closing

拈花ヽ惹草 提交于 2019-12-10 11:07:28
问题 Hello: I have a paper-dialog element in a page: <paper-dialog ... id="autom_desc_dialog" autoCloseDisabled> ... <paper-button ... id="automatizar" affirmative autofocus disabled></paper-button> </paper-dialog> and I have an event listener that handles the paper-button click: var auto_btn = querySelector('#automatizar'); auto_btn.on["click"].listen((Event e) { // Some AJAX stuff }); What I want is that in some cases, to be able to prevent the dialog from closing, I've tried event

HowTo add a required indicator to paper-input

只愿长相守 提交于 2019-12-10 09:54:26
问题 Given the paper-input <paper-input floatingLabel label="Type only numbers... (floating)" validate="^[0-9]*$" error="Input is not a number!"> </paper-input> How do I add some indication that the field is required to the user. 回答1: From the core-input docs https://github.com/Polymer/core-input/blob/master/core-input.html AFAIK paper-input extends core-input therefore this should apply here too: core-input also can optionally validate the value by providing it with a regular expression to match

Polymer-Dart Equivalent Functions

一曲冷凌霜 提交于 2019-12-10 09:46:45
问题 I'm trying to work through a Google I/O codelab for the Material Design Web App, but port it to the Dart language. http://io2014codelabs.appspot.com/static/codelabs/polymer-build-mobile/#4 I'm at the step where you toggle the drawer, but I can't figure out the dart equivalent. The JS code to toggle the drawer looks like this: <script> Polymer('codelab-app', { toggleDrawer: function() { this.$.drawerPanel.togglePanel(); } }); </script> I have tried the following in my CodelabApp class, but I