New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pub serve fails on binded assets since Polymer Dart 0.10.0-pre.13 #19068
Comments
This comment was originally written by kurotensh...@autistici.org I think a part (at least) of the problem is an url encoding issue (base64). |
I have not been able to reproduce the error here. Following your instructions above, I created a project with 4 files, as follows: pubspec.yaml: name: test web/foo/ web/index.html: <polymer-element name='x-foo'> <x-foo></x-foo> <script type='application/dart'> Thanks! Added Area-Polymer, NeedsInfo labels. |
This comment was originally written by kurotensh...@autistici.org I found a simpler way to reproduce the bug : <polymer-element name='img-dyn' attributes='srcdyn iddyn classdyn titledyn'> (with 3 published variables in the associed dart file) => [web] GET /%7B%7Bsrcdyn%7D%7D => Could not find asset CVWebkit|web/%7B%7Bsrcdyn%7D%7D. |
This comment was originally written by kurotensh...@autistici.org Sorry I had starred the topic, but I didn't received mail. And how can I edit a post ? It's clearly the polymer's binding to <img src={{...}}> that bugs since the lastest build of polymer. |
This comment was originally written by kurotensh...@autistici.org My code is very complex so I don't think there is a point to give it to you. In your code, there is 1 differences with mine:
But here is my pub.yaml : name: CVWebkit
|
This comment was originally written by kurotensh...@autistici.org Ha yes, and another difference : The Dart is not embedded in the HTML, but in a .dart file in /lib directory. |
Removed Area-Polymer label. |
This comment was originally written by kurotensh...@autistici.org Here is the dart file associated to the "img-dyn" template sample I supplied earlier : import 'package:polymer/polymer.dart'; @CustomTag('img-dyn') @published String srcdyn=""; The images will not be found, it's normal. The problem is just the binding. Sorry for all these posts. But I can't edit to simplify everything. |
This comment was originally written by kurotensh...@autistici.org I recently learned that assets are loaded first, before anything else. That's why It might be useful to embed assets calls in a polymer element, like in Angular ("ng-src"). |
Added this to the 1.6 milestone. |
Removed this from the 1.6 milestone. |
Removed Polymer-P-1 label. |
Added PolymerMilestone-Next label. |
Removed Polymer-Milestone-Next label. |
This issue has been moved to dart-archive/polymer-dart#197. |
This issue was originally filed by kurotensh...@autistici.org
Summary of the issue :
When trying to dynamically bind images from an observable Dart collection with a template, it works in Dart but cause an issue with Pub Serve (in Javascript so).
How To reproduce the problem :
('Toto' : {'img1', 'img2', 'img3',...}, 'Tata': {'img4', 'img5', 'img6',...},...)
The key can be an id for a <div> and the values an image file name, without extension and path.
<template repeat="{{key in elts.keys}}">
<div id={{key}}>
<img src="./{{elts[key][0]}}.png" id=elts[key][3]>
</div>
</template>
You can embed a second template repeat to display every images. Just put the assets named like in the List (+ png extension) in the right directory.
What is the expected output?
What is expected is several <div> filled with several pictures, dynamically, in Dartium (Dart) and with Dart2JD (Firefox for example).
What I see instead :
Expected result with Dartium (Dart). The Dart2JS build has no error.
But when running with pub serve, blank page and this error :
[web] GET /%7B%7B%20%27/resources/images/%27%20+%20elts%5Bkey%5D%5B3%5D%7D%7D => Could not find asset CVWebkit|web/%7B%7B%20%27/resources/images/%27%20+%20elts%5Bkey%5D%5B3%5D%7D%7D.
Note that my img tag was : <img src="./ressources/images/{{elts[key][3]}}.png" id=elts[key][3] title={{key}}>
What version of the product are you using? On what operating system?
I am using Dart 1.4.0 stable (and tested Dart 1.5.0 dev) with Polymer Dart 0.10.0-pre.13, in Windows 7 SP1 x64 and Windows 8.1 x64.
Additional information :
Attachments:
expected.jpg (104.19 KB)
obtained.jpg (102.27 KB)
[complete message.txt](https://storage.googleapis.com/google-code-attachments/dart/issue-19068/comment-0/complete message.txt) (1.96 KB)
The text was updated successfully, but these errors were encountered: