<p dir="auto"><strong>I'm submitting a ...</strong>  (check one with "x")</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[ ] bug report =&gt; search github for a similar issue or PR before submitting
[x] feature request
[ ] support request =&gt; Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question"><pre class="notranslate"><code class="notranslate">[ ] bug report =&gt; search github for a similar issue or PR before submitting
[x] feature request
[ ] support request =&gt; Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
</code></pre></div>
<p dir="auto"><strong>Current behavior</strong><br>
Only xlf file are supported</p>
<p dir="auto"><strong>Expected behavior</strong><br>
Having a simple JSON file support</p>
<p dir="auto"><strong>What is the motivation / use case for changing the behavior?</strong><br>
I generally don't use extract / merge capabilities for i18n and having to manually right xml in a JS world is painful ^^. I'm use to have my JSON file with key/translation and go for it :)</p>
<p dir="auto">Something like <code class="notranslate">ng2-translate</code> would be awesome (talking about file definitions only because the way they do it is very resourceful).</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[x] bug report
[ ] feature request
[ ] support request"><pre class="notranslate"><code class="notranslate">[x] bug report
[ ] feature request
[ ] support request
</code></pre></div>
<p dir="auto"><strong>Current behavior</strong></p>
<p dir="auto">Many (all?) observable properties are actually <code class="notranslate">Subjects</code>.  <code class="notranslate">route.params</code> is one such example.</p>
<p dir="auto">Yes, these propertes are cast as <code class="notranslate">Observable</code> in TypeScript. But they are actually <code class="notranslate">Subjects</code> and that invites abuse. Because these are also <code class="notranslate">Observer</code>s, a developer ... especially a JavaScript developer ... is invited to call <code class="notranslate">next</code>, <code class="notranslate">error</code>, <code class="notranslate">complete</code>. This is improper.</p>
<p dir="auto">The implementation should call <code class="notranslate">subject.asObservable()</code>. That's why that method exists.</p>
<p dir="auto">This only seem <code class="notranslate">picayune</code> until someone starts calling <code class="notranslate">next</code> "<em>because I have a really good use cast for that.</em>"</p>
<p dir="auto">Fixing the API as recommended would <strong>not</strong> be a breaking change; the intent is clear by the TypeScript cast and anyone who treats <code class="notranslate">route.params</code> as an <code class="notranslate">Observer</code> deserves what s/he gets.</p>
<p dir="auto"><strong>Expected behavior</strong></p>
<p dir="auto">Every observable property based on a <code class="notranslate">Subject</code> should be based on <code class="notranslate">Subject.asObservable()</code>. This prevents attempts to call <code class="notranslate">next</code>, <code class="notranslate">error</code>, <code class="notranslate">complete</code> or any other <code class="notranslate">Observer</code> method.</p>
<p dir="auto"><strong>Minimal reproduction of the problem with instructions</strong></p>
<ol dir="auto">
<li>Load <a href="https://angular.io/resources/live-examples/router/ts/eplnkr.html" rel="nofollow">https://angular.io/resources/live-examples/router/ts/eplnkr.html</a></li>
<li>Add <code class="notranslate">hero-detail.component.ts#ngOnInit</code> ..</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="   let x = this.route.params.asObservable();
   debugger;"><pre class="notranslate"><code class="notranslate">   let x = this.route.params.asObservable();
   debugger;
</code></pre></div>
<ol start="3" dir="auto">
<li>Run and click a hero.</li>
<li>Inspect <code class="notranslate">x</code> and <code class="notranslate">this.route.params</code> and note the real JavaScript types</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&gt; x
Observable {_isScalar: false, source: BehaviorSubject}
&gt; this.route.params
BehaviorSubject {_isScalar: false, observers: Array[0], closed: false, isStopped: false, hasError: false…}"><pre class="notranslate"><code class="notranslate">&gt; x
Observable {_isScalar: false, source: BehaviorSubject}
&gt; this.route.params
BehaviorSubject {_isScalar: false, observers: Array[0], closed: false, isStopped: false, hasError: false…}
</code></pre></div>
<ul dir="auto">
<li><strong>Browser:</strong> [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web</li>
</ul>
<p dir="auto">all</p>
<ul dir="auto">
<li><strong>Language:</strong> [all | TypeScript X.X | ES6/7 | ES5]<br>
TS</li>
</ul>