0
votes

I recently update Dart to Dart SDK version 0.7.1.0_r27025 and have not been able to get conditional templates inside tables to work. The code I have at the moment is:

<td template if="loaded">
    <p>Loading</p>
</td>
<td template if="!loaded">
    <div>...</div>
</td>

However, if I run that in dartium and inspect the DOM all I see is

<td></td>
<td></td>

and I get a RangeError in the code that was generated by build.dart.

Has something changed in how dart handles conditional templates in tables in the latest release?

1
Is build.dart still running for you? I just tested my Web UI samples and they still work. I tested a conditional. Are you running the files in out ?Seth Ladd
Here's a suggestion. Delete the out directory, run build.dart, and then run the relevant file in out/. Conditionals work for me as well, so I'm not sure where the problem is.Shailen Tuli

1 Answers

0
votes

I was able to fix this by doing

<td>
    <template if="!loaded">
        <p>Loading...</p>
    </template>
    <div id="my_id"></div>
</td>

It seems it is no longer necessary to use the template as an attribute in tables.