title: How to detect invalid or undefined custom directive in Angular
body: <p>Angular doesn't recognise and shows up with error if an invalid or undefined custom directive is provided.  Basically I want to show an error if non-existing directive is provided. </p>
  
  <p>Lets say if I have a custom directive by the selector name 'myCustomDirective', then I can apply this directive as follows</p>
  
  <p><code>&lt;div myCustomDirective class="myStyle"&gt;&lt;/div&gt;</code></p>
  
  <p>But when I apply the directive which does not exist say <code>myCusto</code> as shown below, then I want Angular to fail with an error saying something like <code>myCusto</code> is undefined.</p>
  
  <p><code>&lt;div myCusto class="myStyle"&gt;&lt;/div&gt;</code></p>
  
  <p>Appreciate if anyone can answer my question.</p>