title: AngularJS Directive Value
body: <p>I have an AngularJS directive. My directive is restricted to be used as an attribute. However, I want to get the value of the attribute. Currently, I have my attribute defined as:</p>
  
  <pre><code>angular.module('myDirectives.color', [])
      .directive('setColor', function () {
          return {
              retrict: 'A',
              link: {
                  pre: function () {
                      console.log('color is: ');
                  }
              }
          };
      })
  ;
  </code></pre>
  
  <p>I use the attribute in the following manner:</p>
  
  <pre><code>&lt;button type="button" set-color="blue"&gt;Blue&lt;/button&gt;
  &lt;button type="button" set-color="yellow"&gt;Yellow&lt;/button&gt;
  </code></pre>
  
  <p>I know that my directive is being used because I see 'color is: ' However, I can't figure out how to make it display 'blue' or 'yellow' at the end of that console statement. I want to get that value so I can do a conditional processing. How do I get the value of the attribute?</p>
  
  <p>Thank you!</p>