title: Vue.js 2.0 this.$compile
body: <p>How do can you compile a HTML string to template within a component method?
  This was possible in Vue 1 like in this <a href="http://jsfiddle.net/chrislandeza/syewmx4e/" rel="nofollow noreferrer">jsfiddle</a></p>
  
  <pre><code>new Vue({
      el: '#app',
      data: {
          sampleElement: '&lt;button v-on="click: test()"&gt;Test&lt;/button&gt;'
  
      },
      methods:{
          addNewElement: function(){
  
             var element = $('#app').append(this.sampleElement);
              /* compile the new content so that vue can read it */
             this.$compile(element.get(0));
          },
          test: function(){
             alert('Test');
          }
      }
  });
  </code></pre>
  
  <p>How can you do this in Vue 2?</p>