dart-polymer

Dart HttpRequest polling

我的梦境 提交于 2019-12-10 07:22:25
问题 I have a web app that have a Timer that fires a poll to get data every 3 seconds. It works fine for about 2.5 minutes then Chromium crashes. My request Dart looks like this HttpRequest.getString('data/get_load_history_recent.json') .then((e) => _recentHistoryResponse(e)) .catchError((e) => _recentHistoryError(e)); Can you think of any reasons why this would happen? I assume it's a memory leak... Edit: Here is my _recentHistoryResponse() void _recentHistoryResponse(String data) { Map obj =

How to test Polymer Dart

浪尽此生 提交于 2019-12-09 01:52:30
问题 I started testing my web components and noticed that Dart has a good library for that and it does work well with Dart. But now I also want to test my Polymer component, but I'm having a hard time doing that. It seems that my Unit Test does not recognize my Element as a Polymer Element. That how my "test" looks like at the moment test.dart import "../../../components/medium/bar-chart.dart"; import "package:unittest/unittest.dart"; import 'package:polymer/polymer.dart'; import 'dart:html'; main

Dart: Dynamic usage of polymer-ui-tabs and polymer-ui-pages does not work

独自空忆成欢 提交于 2019-12-08 22:31:14
问题 we would like to use polymer-ui-tabs and polymer-ui-pages dynamically. the following static example works fine (attribute selected is set properly, on-polymer-select event is fired) <polymer-ui-tabs selected="{{selectedTab}}" on-polymer-select="{{mymethod}}"> <span>One</span> <span>Two</span> <span>Three</span> </polymer-ui-tabs> <polymer-ui-pages selected="{{selectedTab}}" on-polymer-select="{{mymethod2}}" flex> <span>One</span> <span>Two</span> <span>Three</span> </polymer-ui-pages> When

How to access shadow dow with jquery in a polymer.dart component

我怕爱的太早我们不能终老 提交于 2019-12-08 19:08:36
In my polymer.dart component I want to access the shadow dom with jquery. In dart I can access f.e. an node´s id like this: $["testname"].attributes["id"] or shadowRoot.querySelector("#testname").attributes["id"] How is this done with jquery context.callMethod(r'$', ['#testname'])["id"] does not work obviously. If you want to access shadow DOM from Dart using jquery, you can do this: String selector; JsObject jqueryObject = context.callMethod('\$', ['body /deep/ ${selector}']); Then you can call jquery methods like this: jqueryObject.callMethod('click', [myFunc]); void myFunc(var event) =>

Setting a bool published attribute with @published

柔情痞子 提交于 2019-12-08 15:58:29
I have the following .dart component @CustomTag('description-form') class DescriptionForm extends PolymerElement { @observable Map<String, dynamic> datamap = {}; @observable String description = ''; @published String get label => readValue(#label); set label(String value) => writeValue(#label, value); @published bool get isVisible => readValue(#isVisible); set isVisible(bool value) => writeValue(#isVisible, value); DescriptionForm.created() : super.created(); void publish() { datamap['description'] = description; } @override void attached() { super.attached(); datamap['receiver'] = dataset[

In a DART website/component that is in an iFrame, how can I query elements of the parent window?

本小妞迷上赌 提交于 2019-12-08 07:42:26
问题 collegues, I'm solving my previous ISSUE where I had some performance issues involving the shadow DOM and heavy JS animations that were not done in DART. The proposed solution for this was to move my DART component into an iFrame, to restrict the shadowDOM to the DOM of only that iFrame. Now the QUESTION: How can I query from my DART code elements from JS:window.parent? Any ideas on how can I register listeners to onCLick of elements on the parent iFrame? (I'm using Polymer as well) Thanks in

Setting a bool published attribute with @published

我们两清 提交于 2019-12-08 06:35:57
问题 I have the following .dart component @CustomTag('description-form') class DescriptionForm extends PolymerElement { @observable Map<String, dynamic> datamap = {}; @observable String description = ''; @published String get label => readValue(#label); set label(String value) => writeValue(#label, value); @published bool get isVisible => readValue(#isVisible); set isVisible(bool value) => writeValue(#isVisible, value); DescriptionForm.created() : super.created(); void publish() { datamap[

Custom elements not detecting children when instantiated in template of another custom element

a 夏天 提交于 2019-12-08 06:35:11
问题 I have an RPG Main HTML Element defined as follows. I'm instantiating it in the body of my index.html file. <link rel="import" href="packages/polymer/polymer.html"> <link rel="import" href="gridlayout.html"> <link rel="import" href="gridtile.html"> <polymer-element name="rpg-main" attributes=""> <template> <style> grid-tile { background: #FF00FF; width: 50px; height: 50px } :host { position: absolute; display: block; width: 500px; height: 500px; } </style> <grid-layout rows = "2" cols = "2"

Object binding between Angular and Polymer in Dart

邮差的信 提交于 2019-12-08 04:57:01
问题 I'm trying to bind an object from an Angular controlled element to a Polymer element in Dart. The object to bind: class Person { String name; String surname; Person(this.name, this.surname); } The polymer element template: <link rel="import" href="packages/polymer/polymer.html"> <polymer-element name="person-element"> <template> <style> .label {font-weight: bold;} </style> <p> <span class="label">Name: </span>{{person.name}} <span class="label">Surname: </span>{{person.surname}} </p> <

bwu_datagrid setColumns dynamically deforms while running as JS

那年仲夏 提交于 2019-12-08 04:53:06
问题 I was able to dynamically update the columns/data by using something like this: void setDV(List<Column> cols, List<DataItem> datum) { print('setColnData cols.length: ${columns.length}, datum.length: ${data2.length}'); this.data2.clear(); print("--1: ${data2.length}"); if(this.columns.length < 1){ this.columns = cols; grid.setColumns = columns; } datum.forEach((e) => this.data2.add(e)); print("--2: ${data2.length}"); grid.invalidate(); } Which works in Chromium flawlessly as a Dart app. I'm