How to pass a firebase data into a function
<p>I am trying to pass string into function that is in my javascript file</p>

<p>The variable {{data.title}} is accessible elsewhere in my html file but it seems I am missing something because the function is not receiving the variable as ''</p>

<pre><code>        &lt;a class="item item-icon-left" ng-click="favorites('{{data.title}}')"&gt;
                &lt;i class="icon ion-ios-star-outline"&gt;&lt;/i&gt;
                &lt;span&gt;Add to favorites&lt;/span&gt;
        &lt;/a&gt;
</code></pre>

<p>JS File:</p>

<pre><code>  $scope.favorites = function (x) {
    console.log(x);
    // retrieve it (Or create a blank array if there isn't any info saved yet),
    var favorites = JSON.parse(localStorage.getItem('favoritesInfo')) || [];;
    // add to it,
   favorites.push({ name: x});
    // then put it back.
    localStorage.setItem('favoritesInfo', JSON.stringify(favorites));
    console.log(localStorage.getItem('favoritesInfo'));
  }
</code></pre>