I'm trying to add the material angularjs md-input-container to the DOM via a directive's compile function as following :
element.after(`
<md-input-container md-theme-watch="true" flex>
<label for="sampletext1">Champ texte</label>
<input name="sampletext1" type="text"
class="ng-tree-search">
</md-input-container>
`)
But when I open the page, the element looses it's default behaviour and looks like this :
Instead it should look like this :
This only works when I add the element in the html, but in my case I want to add it via the link function of the directive that creates that treeview.

