title: Angularjs. Accessing attributes from an AngularJS controller
body: <p>I'm trying to access image src with controller to save it, but can not figure out how to do it.</p>
  
  <p>My template:</p>
  
  <pre><code>    &lt;img data-ng-model="book.image"
           style="width: 300px; height: 200px;"
           ng-src="data:image/png;base64,iVBORw0K...SuQmCC"&gt;
      &lt;a data-ng-click="save(book)" class="btn"&gt;Submit&lt;/a&gt;
  </code></pre>
  
  <p>My controller:</p>
  
  <pre><code>    controller('BookEditController', [ '$scope', '$meteor', function ($scope, $meteor) {
          $scope.save = function (book) {
              if (typeof book == 'object') {
                  var books = $meteor("books");
                  var id = books.insert(book);
              }
          };
      }])
  </code></pre>