Share button html data-text with variable in Backbone.js app not working correctly


#1

I am trying to put a share button on my website. I am using Handlebars in a Backbone.js app to render information for the data-text element. I am able to render the text in a paragraph tag, and in the Chrome developer tools, it showing the proper information in the data-text element. But when I click the share button, there is no text in the tweet.

Backbone Template:

Tweet

{{businesses0.attributes.tweetstring}}

<a href="https://twitter.com/share" class="twitter-share-button" data-text="{{businesses1.attributes.tweetstring}}" data-lang="en">Tweet</a>
<p>{{businesses1.attributes.tweetstring}}</p>

Output in Google Chrome:

Tweet

Meet me at Chop Butchery & Charcuterie located at 735 NW 21st Ave

The data is coming from a function that creates an object:

function _addModelToCollection(data, term) {
  this.app.collections.businesses.add({
    name: data.businesses[0].name,
    address: data.businesses[0].location.address +","+ data.businesses[0].location.city +","+ data.businesses[0].location.state_code,
    type: term,
    tweetstring:["Meet me at ", data.businesses[0].name, " located at ", data.businesses[0].location.address].join("")
  });
};

What am I doing here that is causing this issue?


#2