title: Dart Template instantiate migrate from Web UI to Polymer
body: <p>Working old Web UI code:</p>
  
  <pre><code>&lt;template instantiate="if view == 'dashboard'"&gt;
  </code></pre>
  
  <p>Not working Polymer code:</p>
  
  <pre><code>&lt;p&gt;{{view}}&lt;/p&gt; &lt;-- this is ok, prints: dashboard 
  &lt;template if="{{view == 'dashboard'}}"&gt; &lt;-- not work, if I change code to use bool property something like {{showDashboard}} then works ok.
  </code></pre>
  
  <p>What is the correct syntax? I can't find any example of instantiate with string comparison.</p>
  
  <p><em>*</em>*Edit. More details:
  Dart SDK version 0.7.3.1_r27487</p>
  
  <p>html:</p>
  
  <pre><code>  &lt;p&gt;int: {{score}}&lt;/p&gt;
    &lt;template bind if="{{score == 4}}"&gt;
      &lt;p&gt;ins int: {{score}}&lt;/p&gt;
    &lt;/template&gt;
    &lt;p&gt;String: {{view}}&lt;/p&gt;
    &lt;template bind if="{{view == 'dashboard'}}"&gt;
       &lt;p&gt;ins String: {{view}}&lt;/p&gt;
     &lt;/template&gt;  
     &lt;p&gt;bool: {{showp}}&lt;/p&gt;  
     &lt;template bind if="{{showp}}"&gt;
       &lt;p&gt;ins bool: {{showp}}&lt;/p&gt;
     &lt;/template&gt;
  </code></pre>
  
  <p>dart:</p>
  
  <pre><code>class AppModel extends Object with ObservableMixin {
     @observable String view = "dashboard";
     @observable int score = 4;
     @observable bool showp = true;
  }
  
  void main() {
   query("#templ").model = new AppModel();
  }
  </code></pre>
  
  <p>And output:</p>
  
  <pre><code>int: 4
  String: dashboard
  bool: true
  ins bool: true
  </code></pre>