<h1 dir="auto">Normalize string / No interpolation</h1>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked="">  Replace <code class="notranslate">interpolate1 = "" "${componentName0 == null ? "" : componentName0}" ""</code> with <code class="notranslate">interpolate1 = " " + stringify(componentName0) + " ";</code> NOTE: will require import of <code class="notranslate">stringify</code> method. I think <code class="notranslate">${}</code> creates extra unneeded checks, so simple string concat <code class="notranslate">+</code> should be better in this case.</li>
</ul>
<h1 dir="auto">Inline assignments</h1>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> take advantage of multiple assignments per line.</li>
</ul>
<p dir="auto">``` Dart``<br>
_componentName0 = _gen.ChangeDetectionUtil.uninitialized();<br>
_interpolate1 = _gen.ChangeDetectionUtil.uninitialized();<br>
_directive_1_0 = _gen.ChangeDetectionUtil.uninitialized();<br>
_directive_2_0 = _gen.ChangeDetectionUtil.uninitialized();</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="
becomes:

``` Dart
 _componentName0 = _interpolate1 = _directive_1_0 = _directive_2_0 
       = _gen.ChangeDetectionUtil.uninitialized;"><pre class="notranslate"><code class="notranslate">
becomes:

``` Dart
 _componentName0 = _interpolate1 = _directive_1_0 = _directive_2_0 
       = _gen.ChangeDetectionUtil.uninitialized;
</code></pre></div>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Also call <code class="notranslate">dehydrateDirectives()</code> from constructor so that we don't have to duplicate the code in the constructor.</li>
</ul>
<h1 dir="auto">Inline assignments and usages</h1>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> inline where ever possible.</li>
</ul>
<div class="highlight highlight-source-dart notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="        _dispatcher.notifyOnBinding(currentProto.bindingRecord, interpolate1);
        _interpolate1 = interpolate1;"><pre class="notranslate">        _dispatcher.<span class="pl-en">notifyOnBinding</span>(currentProto.bindingRecord, interpolate1);
        _interpolate1 <span class="pl-k">=</span> interpolate1;</pre></div>
<p dir="auto">becomes</p>
<div class="highlight highlight-source-dart notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="        _dispatcher.notifyOnBinding(currentProto.bindingRecord, _interpolate1 = interpolate1);"><pre class="notranslate">        _dispatcher.<span class="pl-en">notifyOnBinding</span>(currentProto.bindingRecord, _interpolate1 <span class="pl-k">=</span> interpolate1);</pre></div>
<h1 dir="auto">have <code class="notranslate">notifyOnBinding</code> helper</h1>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> create <code class="notranslate">viewSet</code> in super. Notice that <code class="notranslate">_dispatcher</code> is always a View. This code is no longer abstract so we should use concrete names.</li>
</ul>
<div class="highlight highlight-source-dart notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="currentProto = _protos[1]
...     
change_interpolate1 = true;
_dispatcher.notifyOnBinding(currentProto.bindingRecord, interpolate1);
_interpolate1 = interpolate1;"><pre class="notranslate">currentProto <span class="pl-k">=</span> _protos[<span class="pl-c1">1</span>]
...     
change_interpolate1 <span class="pl-k">=</span> <span class="pl-c1">true</span>;
_dispatcher.<span class="pl-en">notifyOnBinding</span>(currentProto.bindingRecord, interpolate1);
_interpolate1 <span class="pl-k">=</span> interpolate1;</pre></div>
<p dir="auto">becomes</p>
<div class="highlight highlight-source-dart notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="        change_interpolate1 = viewSet(1, _interpolate1 = interpolate1);"><pre class="notranslate">        change_interpolate1 <span class="pl-k">=</span> <span class="pl-en">viewSet</span>(<span class="pl-c1">1</span>, _interpolate1 <span class="pl-k">=</span> interpolate1);</pre></div>
<p dir="auto">which requires this method on superclass</p>
<div class="highlight highlight-source-dart notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="  boolean viewSet(int index, dynamic value) {
    _view.notifyOnBinding(protos[index].bindingRecord, value);
    return true;
  }"><pre class="notranslate">  boolean <span class="pl-en">viewSet</span>(<span class="pl-c1">int</span> index, <span class="pl-c1">dynamic</span> value) {
    _view.<span class="pl-en">notifyOnBinding</span>(protos[index].bindingRecord, value);
    <span class="pl-k">return</span> <span class="pl-c1">true</span>;
  }</pre></div>
<h1 dir="auto"><code class="notranslate">looseNotIdentical</code></h1>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> have <code class="notranslate">loseNotIdentical</code> which will allow us to change <code class="notranslate">if (!_gen.looseIdentical(...))</code> to <code class="notranslate">if (_gen.looseNotIdentical(...))</code>. (its only one char, but it is everywhere)</li>
</ul>
<h1 dir="auto">inline context assignment</h1>
<div class="highlight highlight-source-dart notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="    var context = null;
    context = _context;"><pre class="notranslate">    <span class="pl-k">var</span> context <span class="pl-k">=</span> <span class="pl-c1">null</span>;
    context <span class="pl-k">=</span> _context;</pre></div>
<p dir="auto">should be</p>
<div class="highlight highlight-source-dart notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="    var context = _context;"><pre class="notranslate">    <span class="pl-k">var</span> context <span class="pl-k">=</span> _context;</pre></div>
<h1 dir="auto">Unused <code class="notranslate">change_context</code></h1>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> the code is never used in output</li>
</ul>
<div class="highlight highlight-source-dart notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var change_context = false;"><pre class="notranslate"><span class="pl-k">var</span> change_context <span class="pl-k">=</span> <span class="pl-c1">false</span>;</pre></div>
<p dir="auto">but is never read.</p>
<h1 dir="auto">change <code class="notranslate">uninitialized()</code> method call to <code class="notranslate">uninitialized</code> static field</h1>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> should save some chars</li>
</ul>
<p dir="auto"><strong>I'm submitting a ...</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[X] bug report"><pre class="notranslate"><code class="notranslate">[X] bug report
</code></pre></div>
<p dir="auto"><strong>Current behavior</strong></p>
<p dir="auto">I have some routes like:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const routes = [
    { path: &quot;&quot;, component: HomeComponent, pathMatch: &quot;full&quot; },
    { path: &quot;profile&quot;, component: ProfileComponent },
    { path: &quot;menu&quot;, component: MenuComponent, outlet: &quot;sidebar&quot; },
];"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-s1">routes</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span>
    <span class="pl-kos">{</span> <span class="pl-c1">path</span>: <span class="pl-s">""</span><span class="pl-kos">,</span> <span class="pl-c1">component</span>: <span class="pl-smi">HomeComponent</span><span class="pl-kos">,</span> <span class="pl-c1">pathMatch</span>: <span class="pl-s">"full"</span> <span class="pl-kos">}</span><span class="pl-kos">,</span>
    <span class="pl-kos">{</span> <span class="pl-c1">path</span>: <span class="pl-s">"profile"</span><span class="pl-kos">,</span> <span class="pl-c1">component</span>: <span class="pl-smi">ProfileComponent</span> <span class="pl-kos">}</span><span class="pl-kos">,</span>
    <span class="pl-kos">{</span> <span class="pl-c1">path</span>: <span class="pl-s">"menu"</span><span class="pl-kos">,</span> <span class="pl-c1">component</span>: <span class="pl-smi">MenuComponent</span><span class="pl-kos">,</span> <span class="pl-c1">outlet</span>: <span class="pl-s">"sidebar"</span> <span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-kos">]</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">When the route <code class="notranslate">http://localhost/(sidebar:menu)</code> is open, then I'm able to remove the named outlet and go to <code class="notranslate">http://localhost/</code> by clicking an anchor like the following:</p>
<div class="highlight highlight-text-html-basic notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&lt;a [routerLink]=&quot;['', {outlets: {sidebar: null}}]&quot;&gt;
    Close
&lt;/a&gt;"><pre class="notranslate"><span class="pl-kos">&lt;</span><span class="pl-ent">a</span> <span class="pl-c1">[routerLink]</span>="<span class="pl-s">['', {outlets: {sidebar: null}}]</span>"<span class="pl-kos">&gt;</span>
    Close
<span class="pl-kos">&lt;/</span><span class="pl-ent">a</span><span class="pl-kos">&gt;</span></pre></div>
<p dir="auto">What doesn't work is navigating away from the sidebar <strong>and also</strong> going to another route like  <code class="notranslate">http://localhost/profile</code>.</p>
<div class="highlight highlight-text-html-basic notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&lt;a [routerLink]=&quot;['/profile', {outlets: {sidebar: null}}]&quot;&gt;
    Close
&lt;/a&gt;"><pre class="notranslate"><span class="pl-kos">&lt;</span><span class="pl-ent">a</span> <span class="pl-c1">[routerLink]</span>="<span class="pl-s">['/profile', {outlets: {sidebar: null}}]</span>"<span class="pl-kos">&gt;</span>
    Close
<span class="pl-kos">&lt;/</span><span class="pl-ent">a</span><span class="pl-kos">&gt;</span></pre></div>
<p dir="auto">The link that is rendered is <code class="notranslate">http://localhost:3971/profile(sidebar:menu)</code></p>
<p dir="auto"><strong>Expected behavior</strong></p>
<p dir="auto">The link that should be rendered is <code class="notranslate">http://localhost:3971/profile</code>.</p>
<p dir="auto"><strong>Repro</strong></p>
<p dir="auto"><a href="https://github.com/tinchou/router-repro">https://github.com/tinchou/router-repro</a></p>
<p dir="auto"><strong>Please tell us about your environment:</strong></p>

<p dir="auto">Windows 10, Visual Studio 2017</p>
<ul dir="auto">
<li>
<p dir="auto"><strong>Angular version:</strong> 2.3.1 (didn't work with 2.1.0 either)</p>
</li>
<li>
<p dir="auto"><strong>Browser:</strong> all</p>
</li>
<li>
<p dir="auto"><strong>Language:</strong> TypeScript 2.0.10</p>
</li>
</ul>