<ul class="contains-task-list">
<li><strong>I'm submitting a ...</strong></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> bug report</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> feature request</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> support request =&gt; Please do not submit support request here, see note at the top of this template.</li>
</ul>
<p dir="auto"><strong>Current behavior</strong></p>
<p dir="auto"><code class="notranslate">&lt;script&gt;</code> and <code class="notranslate">&lt;style&gt;</code> tags are stripped from templates, but they are listed in the DOM element registry as supported, complete with DOM properties, etc.: <a href="https://github.com/angular/angular/blob/master/modules/%40angular/compiler/src/schema/dom_element_schema_registry.ts">https://github.com/angular/angular/blob/master/modules/%40angular/compiler/src/schema/dom_element_schema_registry.ts</a></p>
<p dir="auto"><strong>Expected/desired behavior</strong></p>
<p dir="auto">They should be at least removed from the registry. Even better, they could be marked as forbidden in the registry so that it's clear that they don't fall in the 'unknown' tag category.</p>
<p dir="auto"><strong>Angular version:</strong> GitHub repo, master branch</p>
<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/mprobst/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/mprobst">@mprobst</a> advised me to CC <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/tbosch/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/tbosch">@tbosch</a> and <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/mhevery/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/mhevery">@mhevery</a> for this issue, thanks for taking a look at it!</p>
<h2 dir="auto">I'm submitting a...</h2>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="
[x] Bug report  
[x] Feature request"><pre class="notranslate"><code class="notranslate">
[x] Bug report  
[x] Feature request
</code></pre></div>
<h2 dir="auto">Background</h2>
<p dir="auto">Imagine you have the following webcomponent:</p>
<div class="highlight highlight-text-html-basic notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&lt;expression&gt;
	&lt;script type='text/plain'&gt;
		If(var1 &lt; var2,
			Sum([Field 1])
		,
			Sum([Field 2])
		)
	&lt;/script&gt;
&lt;/expression&gt;"><pre class="notranslate"><span class="pl-kos">&lt;</span><span class="pl-ent">expression</span><span class="pl-kos">&gt;</span>
	<span class="pl-kos">&lt;</span><span class="pl-ent">script</span> <span class="pl-c1">type</span>='<span class="pl-s">text/plain</span>'<span class="pl-kos">&gt;</span>
		<span class="pl-v">If</span><span class="pl-kos">(</span><span class="pl-s1">var1</span> <span class="pl-c1">&lt;</span> <span class="pl-s1">var2</span><span class="pl-kos">,</span>
			<span class="pl-v">Sum</span><span class="pl-kos">(</span><span class="pl-kos">[</span><span class="pl-v">Field</span> <span class="pl-c1">1</span><span class="pl-kos">]</span><span class="pl-kos">)</span>
		<span class="pl-kos">,</span>
			<span class="pl-v">Sum</span><span class="pl-kos">(</span><span class="pl-kos">[</span><span class="pl-v">Field</span> <span class="pl-c1">2</span><span class="pl-kos">]</span><span class="pl-kos">)</span>
		<span class="pl-kos">)</span>
	<span class="pl-kos">&lt;/</span><span class="pl-ent">script</span><span class="pl-kos">&gt;</span>
<span class="pl-kos">&lt;/</span><span class="pl-ent">expression</span><span class="pl-kos">&gt;</span></pre></div>
<p dir="auto">The component reads the text inside the script tag and sends it to a server which evaluates the result.</p>
<p dir="auto">The webcomponent should be embedded in an Angular App. It is no Angular component and should just rendered as is.</p>
<p dir="auto">It has to contain a script tag because <code class="notranslate">'text/plain'</code> allows it not to be parsed as HTML and like this, it is possible for expressions to contain characters like <code class="notranslate">&lt;</code> as in <code class="notranslate">var1 &lt; var2</code> without being recognized as the beginning of a html tag.</p>
<h2 dir="auto">Current behavior</h2>
<p dir="auto">Angular deletes all script tags inside templates, also those with text/plain. I read, that this is because you shouldn't mix JavaScript with Angular Templates, but this is just plain text.</p>
<h2 dir="auto">Expected behavior</h2>
<p dir="auto"><code class="notranslate">&lt;script type="text/plain"</code> should not be deleted. It is the only way to integrate text without having to escape all html characters.</p>
<h2 dir="auto">Minimal reproduction of the problem with instructions</h2>
<p dir="auto">Insert the following code into a template and see if it will be deleted.</p>
<div class="highlight highlight-text-html-basic notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&lt;script type='text/plain'&gt;
    If(var1 &lt; var2,
        Sum([Field 1])
    ,
        Sum([Field 2])
    )
&lt;/script&gt;"><pre class="notranslate"><span class="pl-kos">&lt;</span><span class="pl-ent">script</span> <span class="pl-c1">type</span>='<span class="pl-s">text/plain</span>'<span class="pl-kos">&gt;</span>
    <span class="pl-v">If</span><span class="pl-kos">(</span><span class="pl-s1">var1</span> <span class="pl-c1">&lt;</span> <span class="pl-s1">var2</span><span class="pl-kos">,</span>
        <span class="pl-v">Sum</span><span class="pl-kos">(</span><span class="pl-kos">[</span><span class="pl-v">Field</span> <span class="pl-c1">1</span><span class="pl-kos">]</span><span class="pl-kos">)</span>
    <span class="pl-kos">,</span>
        <span class="pl-v">Sum</span><span class="pl-kos">(</span><span class="pl-kos">[</span><span class="pl-v">Field</span> <span class="pl-c1">2</span><span class="pl-kos">]</span><span class="pl-kos">)</span>
    <span class="pl-kos">)</span>
<span class="pl-kos">&lt;/</span><span class="pl-ent">script</span><span class="pl-kos">&gt;</span></pre></div>
<h2 dir="auto">What is the motivation / use case for changing the behavior?</h2>
<p dir="auto">If <code class="notranslate">&lt;script type="text/plain"</code> would not be deleted it is possible to insert everything which is not html without having to escape it. HTML 5 supports it and as far as I know there is no alternative. Also it isn't a security vulnerability.</p>
<h2 dir="auto">Environment</h2>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="
Angular version: 6.1.0
Browser:
- [x] Chrome (desktop) version 69"><pre class="notranslate"><code class="notranslate">
Angular version: 6.1.0
Browser:
- [x] Chrome (desktop) version 69
</code></pre></div>