title: Controller replaced with Component angular 2
body: <p>I am little confused to differentiate between <code>Component</code> vs <code>Controller</code>. <em><strong>How Controller replaced with component in angular 2?</strong></em> I read about component:</p>
  <blockquote>
  <p>In Angular, a Component is a special kind of directive that uses a simpler configuration which is suitable for a component-based application structure.</p>
  <p>This makes it easier to write an app in a way that's similar to using Web Components or using Angular 2's style of application architecture.</p>
  <p><strong>Advantages of Components</strong>:</p>
  <ul>
  <li>simpler configuration than plain directives</li>
  <li>promote sane defaults and best practices</li>
  <li>optimized for component-based architecture</li>
  <li>writing component directives will make it easier to upgrade to Angular 2</li>
  </ul>
  <p><strong>When not to use Components</strong>:</p>
  <ul>
  <li>for directives that need to perform actions in compile and pre-link functions, because they aren't available</li>
  <li>when you need advanced directive definition options like priority, terminal, multi-element</li>
  <li>when you want a directive that is triggered by an attribute or CSS class, rather than an element.</li>
  </ul>
  </blockquote>
  <p>from <a href="https://docs.angularjs.org/guide/component" rel="noreferrer">AngularJs Documentation</a></p>
  <p><strong>Also</strong>, Read difference between <a href="https://gist.github.com/toddmotto/5b4de6c777d3e446e6410fdadb824522" rel="noreferrer">Directive vs Component</a></p>
  <p>But I am implementing same <code>logic</code> in <code>component</code> which we are doing in <code>controller</code>.</p>
  <p>So can someone explain about the same? And How to think about the architecture of the application in <strong>component</strong> perspective over <strong>controller</strong>.</p>