title: What is the main difference between the decorators @Input() and @Attribute() in Angular2?
body: <p>I have seen @Attribute() being used in Directives usually as a parameter in the constructor like this:</p>
  
  <pre><code>export class EqualValidator implements Validator {
      constructor( @Attribute(‘validateEqual’) public validateEqual: string) {}
      validate(c: AbstractControl): { [key: string]: any } {}
  }
  </code></pre>
  
  <p>and @Input() used in Components like this:</p>
  
  <pre><code>export class UserProfile {
      @Input() user;
      constructor() {}
  }
  </code></pre>
  
  <p>And then you can pass data into these variables in the template with property binding in the case of @Input().</p>
  
  <p>What are the main differences between these decorators and when should you use them?</p>