dart-polymer

Getting error converting dart2js on polymer project

北慕城南 提交于 2019-12-05 23:23:29
Unsupported operation: Can't use ownerName in reflection because it is not included in a @MirrorsUsed annotation. ownerName is just an published attribute on the polymer element. I understand there are a few things out there (on web, not on here) like this but none have a solid answer... I also get this below it: NoSuchMethodError : method not found: 'Symbol("title")' Anyone got any ideas. Been wrestling with this for 3 hours and ready to dump polymer. Though It was fun in dartium, if it cannot convert to JS I see no real use in it. import 'package:polymer/polymer.dart'; import 'package:google

Polymer-Dart Equivalent Functions

社会主义新天地 提交于 2019-12-05 22:34:41
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 get a NoSuchMethodError: method not found: 'togglePanel' @CustomTag('codelab-app') class CodelabApp

Programmatically create special Polymer-Element

那年仲夏 提交于 2019-12-05 19:42:46
I have got a polymer-element with following html: <polymer-element name="tab-bar"> <template> <button>Hello</button> <template repeat="{{item in items}}"> <div>This element is {{ item }}</div> </template> </template> <script type="application/dart" src="tab_bar.dart"></script> </polymer-element> The underlying dart class looks as follows: import 'package:polymer/polymer.dart'; @CustomTag('tab-bar') class TabBar extends PolymerElement { List items; TabBar(List<String> items) { this.items = toObservable(items); } } With the following approach, it isn't possible to programmatically add the

In polymer-dart how do I count inside a repeating template

泄露秘密 提交于 2019-12-05 19:23:52
Say I've got a repeating template: <template bind repeat id='my-template'> This is the bound value: <span id="#myid[x]"> {{}} </span> </template> what can I replace [x] with that will be unique? Access to the loop counter would do the trick, but I'm open to suggestions. I'm adding some utilities to Fancy Syntax (Polymer.dart's default binding syntax now) to help with this, but the basic outline is to run your collection though a filter that will add indices and return a new Iterable. Here's some code that will do it now though: import 'package:fancy_syntax/fancy_syntax.dart'; import 'package

Creating a dataList programmatically

ⅰ亾dé卋堺 提交于 2019-12-05 19:02:55
I am trying to create a table programmatically where one of the cells contains a datalist. Below is the snippet @CustomTag( 'phone-form') class PhoneForm extends PolymerElement { @observable List<String> providers = [ '', 'AT&T', 'Digicel', 'Flow', 'Lime' ]; @observable List<String> phones = ['', 'Car', 'Call-back', 'Fax', 'Home', 'Home Fax', 'Home Mobile', 'Home Video', 'Mobile', 'Pager', 'Work', 'Work Direct', 'Work Fax', 'Work Mobile', 'Work Video', 'Next-of-Kin Home', 'Next-of-Kin Mobile', 'Next-of-Kin Work', 'Tollfree', 'Web Phone']; int phoneSelectedIndex = 0; TableElement table;

Is there the a way to prevent HTML escaping inside a Polymer expression? [duplicate]

◇◆丶佛笑我妖孽 提交于 2019-12-05 15:45:00
This question already has an answer here : How can I bind a text which contains url as html (1 answer) Closed 5 years ago . My colleague Patrick & I currently converting an autocomplete component from Web UI to Polymer.dart.In Web UI we provided a HTML rendered list to the autocomplete in order to give a programmer the opportunity to style the results. Based on the input's value we filtered the list and displayed the matching results. What would you recommend to achieve the same behaviour in Polymer.dart? Should we approach this completly differently? Old Web UI code: <template iterate="entry

polymer dart vs polymer js: does it matter when using the component?

和自甴很熟 提交于 2019-12-05 12:15:10
I want to build a polymer component. I can build it using Javascript. I can build it using Dart. For the person using it (me, someone else), does it make a difference or is the polymer packaging hiding all the magic inside? When you build it in JavaScript you should be able to use it in Dart. There are some problems and it might need some manual tweaking to make it work. This is work in progress and will become easier soon (for example bower support for Darts pub ). There is a package that helps generating a wrapper for Polymer.js elements to be easily used in Dart https://pub.dartlang.org

How to use and to iterate an observable map in Dart Polymer?

巧了我就是萌 提交于 2019-12-05 10:29:38
Consider the following code: myexample.html <polymer-element name="my-example"> <script type="application/dart" src="myexample.dart"></script> <template> <style></style> <div> <ul> <template repeat="{{ entry in map.values }}"> <li>{{ entry }}</li> </template> </ul> <button on-click="{{add}}">Add</button> </div> </template> </polymer-element> myexample.dart @CustomTag('my-example') class MyExample extends PolymerElement { @observable Map<int, String> map = toObservable({}); int i = 0; MyExample.created() : super.created(); void add() { map[i++] = i.toString(); } } The map is filled on every

How to subscribe to change of an observable field

送分小仙女□ 提交于 2019-12-05 08:03:21
until lately I could use bindProperty like shown below or in this question , but that has changed with 0.8.0 and I don't know how to change my code to get the old behaviour (doSomething() gets called): <polymer-element name="my-login" attributes="model"> <template> <template if="{{"model.isLoggedIn}}"> ... </template> </template> <script type= ... ></script> </polymer-element> . @CustomTag("my-login") class MyLogin extends PolymerElement with ObservableMixin { LoginModel model; @override inserted() { void doSomething() { ... } logoutChangeSubscription = bindProperty(model, #isLoggedIn, () =>

I have greek text on a String in Dart using Polymer, why is it displayed wrongly on the browser?

懵懂的女人 提交于 2019-12-05 06:40:37
问题 I have the following String on my Dart code, using Polymer: @observable String title = "Καλώς Ήρθατε Ξανά!"; But this is what I see on the browser: Καλώς ΉÏθατε Ξανά! What am I missing ? When the text uses the regular Latin chars, everything is perfect. Thank you in forward 回答1: Try this: Import: import 'dart:convert' show UTF8; Code: List<int> encoded = UTF8.encode('Καλώς Ήρθατε Ξανά!'); @observable String title = UTF8.decode(encoded); Short Code: @observable String title =