In a polymer.dart element, I need to load a resource. The problem is I don't know the location of that resource.
Here is the organization of my sources:
web/
|- my_project.dart
|- my_project.html
|- my_project.css
|- element/
|- element.html
|- element.dart
|- res.txt
I need, in element.dart, to load res.txt
.
For that, I use:
HttpRequest.getString('res.txt');
And it tries to load /res.txt
instead of /element/res.txt
.
Of course, if I do...
HttpRequest.getString('element/res.txt');
...it works, but that is not sufficient for me as I want my polymer elements to be as portable and reusable as possible (which is the purpose of polymer) and I don't want my elements to be location dependent.
I should also point out that it worked correctly in Polymer.dart until version 0.8.5.
So, I guess I would like something like...
HttpRequest.getString(getElementLocation() + '/res.txt');
...but I haven't found anything corresponding.
Is this possible ?