title: Change background color from input
body: <p>I'm using angular. I have a input that looks like:</p>
  
  <pre><code>&lt;input class="form-control" type="text" ng-model="newBook.color"&gt;
  </code></pre>
  
  <p>basically when this is changed, I want a div's background color to be changed.</p>
  
  <p>My controller has some lines that look like:</p>
  
  <pre><code>$scope.newBook = {};
  $scope.newBook.color = "";
  
  $scope.color = -&gt;
    return "background-color: " + $scope.newBook.color;
  </code></pre>
  
  <p>and then the div I want to change:</p>
  
  <pre><code>&lt;div ng-style="{{color()}}"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>However, I get the error: <code>Error: [$parse:syntax] Syntax Error: Token ':' is an unexpected token at column 17 of the expression [background-color:]</code></p>