<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[x] bug report =&gt; search github for a similar issue or PR before submitting
[x] feature request"><pre class="notranslate"><code class="notranslate">[x] bug report =&gt; search github for a similar issue or PR before submitting
[x] feature request
</code></pre></div>
<p dir="auto"><strong>Current behavior</strong><br>
I want basic inheritance concept:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="export abstract class AbstractForm{
 abstract data;
 constructor(protected dialog: DialogService){}
}
//then use it in component
@Component({
  selector: 'abc',
  template: '...'
})
export class AbcComponent extends AbstractForm{
 data = {}
// here I don't want create same constructor one more time and call super(dialog) 
}"><pre class="notranslate"><code class="notranslate">export abstract class AbstractForm{
 abstract data;
 constructor(protected dialog: DialogService){}
}
//then use it in component
@Component({
  selector: 'abc',
  template: '...'
})
export class AbcComponent extends AbstractForm{
 data = {}
// here I don't want create same constructor one more time and call super(dialog) 
}
</code></pre></div>
<p dir="auto">But here I get error:</p>
<blockquote>
<p dir="auto">Uncaught (in promise): Error: Can't resolve all parameters for AbcComponent : (?).<br>
Error: Can't resolve all parameters for AbcComponent : (?).</p>
</blockquote>
<p dir="auto">I don't have error with language-service and in my webstorm all seems correct, I only get this response directly when launch app in browser, even ng serve and ng build --prod works well, <strong>BUT</strong> even when I decorate my AbstractClass with <code class="notranslate">@Component({})</code> it doesn't works on build and angular language service tell me</p>
<blockquote>
<p dir="auto">Error:(9, 2) Angular: Component 'AbstractForm' is not included in a module and will not be available inside a template. Consider adding it to a NgModule declaration</p>
</blockquote>
<p dir="auto">I don't want add this abstract class into ngModule because it's only an abstraction and I will never use it inside a template, while on dev mod it works (even if angular-language-service awar from this)</p>
<p dir="auto"><strong>Expected behavior</strong><br>
I juste want avoid set consctructor again while I don't need specify other DI it's annoying to always add duplicate code in each component extending this AbstractForm:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="constructor(protected dialog : DialogService) {
    super(dialog);
  }"><pre class="notranslate"><code class="notranslate">constructor(protected dialog : DialogService) {
    super(dialog);
  }
</code></pre></div>
<p dir="auto"><strong>Minimal reproduction of the problem with instructions</strong><br>
see above ( can't reproduce on plunkr)</p>
<p dir="auto"><strong>What is the motivation / use case for changing the behavior?</strong><br>
avoid annoying duplication of code : i don't want call abstract constructor using super()... when on child I don't have one; simply use existant constructor wirted in abstract class</p>
<p dir="auto"><strong>Please tell us about your environment:</strong><br>
win10, webstorm 2017.1.3</p>
<ul dir="auto">
<li><strong>Angular version:</strong></li>
</ul>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="@angular/cli: 1.0.2
node: 7.7.2
os: win32 x64
@angular/common: 4.1.1
@angular/compiler: 4.1.1
@angular/core: 4.1.1
@angular/forms: 4.1.1
@angular/http: 4.1.1
@angular/platform-browser: 4.1.1
@angular/platform-browser-dynamic: 4.1.1
@angular/router: 4.1.1
@angular/cli: 1.0.2
@angular/compiler-cli: 4.1.1
@angular/language-service: 4.1.1"><pre class="notranslate"><code class="notranslate">@angular/cli: 1.0.2
node: 7.7.2
os: win32 x64
@angular/common: 4.1.1
@angular/compiler: 4.1.1
@angular/core: 4.1.1
@angular/forms: 4.1.1
@angular/http: 4.1.1
@angular/platform-browser: 4.1.1
@angular/platform-browser-dynamic: 4.1.1
@angular/router: 4.1.1
@angular/cli: 1.0.2
@angular/compiler-cli: 4.1.1
@angular/language-service: 4.1.1
</code></pre></div>
<ul dir="auto">
<li><strong>Browser:</strong> [all]</li>
<li><strong>Language:</strong> [ts 2.3]</li>
</ul>
<p dir="auto"><code class="notranslate">dashCaseToCamelCase</code> and <code class="notranslate">camelCaseToDashCase</code> are duplicated:</p>
<p dir="auto"></p><div class="Box Box--condensed my-2">
  <div class="Box-header f6">
    <p class="mb-0 text-bold">
      <a href="https://github.com/angular/angular/blob/58dd75a1c8abfa8396ead9b2b1c95dc6c6558668/modules/angular2/src/core/compiler/property_setter_factory.js#L9">angular/modules/angular2/src/core/compiler/property_setter_factory.js</a>
    </p>
    <p class="mb-0 color-fg-muted">
         Line 9
      in
      <a data-pjax="true" class="commit-tease-sha" href="/angular/angular/commit/58dd75a1c8abfa8396ead9b2b1c95dc6c6558668">58dd75a</a>
    </p>
  </div>
  <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data">
    <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">

        <tbody><tr class="border-0">
          <td id="L9" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="9"></td>
          <td id="LC9" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">export</span> <span class="pl-k">function</span> <span class="pl-en">dashCaseToCamelCase</span><span class="pl-kos">(</span><span class="pl-s1">input</span>:<span class="pl-s1">string</span><span class="pl-kos">)</span>: <span class="pl-s1">string</span> <span class="pl-kos">{</span> </td>
        </tr>
    </tbody></table>
  </div>
</div>
 &amp; <a href="https://github.com/angular/angular/blob/58dd75a1c8abfa8396ead9b2b1c95dc6c6558668/modules/angular2/src/core/compiler/pipeline/util.js">https://github.com/angular/angular/blob/58dd75a1c8abfa8396ead9b2b1c95dc6c6558668/modules/angular2/src/core/compiler/pipeline/util.js</a><p></p>
<p dir="auto">Where should be move them and short support fns in general ?</p>
<p dir="auto">/cc <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/pkozlowski-opensource/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/pkozlowski-opensource">@pkozlowski-opensource</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/Mlaval/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/Mlaval">@Mlaval</a></p>