title: Materialize Chips Initialization using string value from database
body: <p>I'm trying to initialize chips with a default value from my database. <br>
  Base on the documentation <a href="http://materializecss.com/chips.html#properties" rel="nofollow noreferrer">here</a> <br>
  This is the proper way of doing it.</p>
  
  <pre><code>  $('.chips-initial').material_chip({
      data: [{
        tag: 'Apple',
      }, {
        tag: 'Microsoft',
      }, {
        tag: 'Google',
      }],
    });
  </code></pre>
  
  <p>And what I'm trying to do is replace those tag with my own tag by using a single string. <br> Here is what I've tried so far <br>
  I have a string with a value of <code>{Tag1}{Tag2}{Tag3}</code><br>
  And I've use this code to replace that string.</p>
  
  <pre><code>    var str = Tag;
      var mapObj = {
          '{':"{tag:'",
          '}':"',},"
      };
      str = str.replace(/{|}/gi, function(matched){
          return mapObj[matched];
      });
  </code></pre>
  
  <p>Now when I try to use this formatted string <code>str</code> to match the proper initialization format. I don't get my intended result.</p>
  
  <pre><code>    $('.chips-initial').material_chip({
          data: [str],
      });
  </code></pre>