title: Angular directive accessing controller - Strange 'ungoogled' message
body: <p>I am trying to write an element directive, which I attach to a controller, in order to implement a sort-like behaviour. This is the directive</p>
  
  <pre><code>.directive('sorting', function () {
          return {
              restrict: 'E',
              scope: false, // I know I can omit this with no effect
              template: function (elem, attr) {
                  return '&lt;div&gt;&lt;a href ng-click="setsort('+"'"+attr.sortkey+"'"+')"&gt;'+attr.headtext+'&lt;/a&gt;&lt;/div&gt;'+
                        '&lt;div ng-show="sortfield=='+"'"+attr.sortkey+"' || sortfield='-"+attr.sortkey+"'"+
                        '" ng-class="{'+"'sortreverse':sortreverse}"+'"&gt;&amp;#9650;&lt;/div&gt;';
                    }
              }
          });
  </code></pre>
  
  <p><code>setsort(sortkey)</code>, <code>sortfield</code> and <code>sortreverse</code> belong to the scope of the controller.</p>
  
  <p>Intended behaviour is that the caret (<code>&amp;#9650;</code>) should only be displayed if sorting is selected for the specified element.</p>
  
  <p>Sorting works as planned, however the caret displays in all sorting columns and I get a strange error message by angular, for which I cannot find any available feedback.</p>
  
  <p>The error says:</p>
  
  <pre><code>Error: [$parse:lval] Trying to assing a value to a non l-value
  http://errors.angularjs.org/1.4.5/$parse/lval
  minErr/
  [....a whole stacktrace ...]
  "&lt;div ng-show="sortfield=='yn_equivalent' || sortfield='-yn_equivalent'" ng-class="{'sortreverse':sortreverse}"&gt;"
  </code></pre>
  
  <p><em>Fun fact</em>: The first line of the error is actually misspelled by angularjs (should be <code>assign</code> instead of <code>assing</code>)</p>
  
  <p>The last line is part of the produced output by the directive, when summoned like this:</p>
  
  <pre><code>&lt;sorting sortkey="yn_equivalent" headtext="SomeText"&gt;&lt;/sorting&gt;
  </code></pre>
  
  <p>I am not very experienced with Angularjs, so perhaps you will need some more feedback, which I'll be glad to give.</p>
  
  <p>Any clues?</p>
  
  <p>Thanks.</p>