I want to create a new element in my controller and then add a scope variable to this. The way I did it, I only see '{{text}}' in the view instead of the variable value of $scope.text.
That's my code so far:
JS:
var elem = document.getElementById('match-text');
var newElem = document.createElement('span');
newElem.setAttribute('id', 'inner-match-text');
newElem.setAttribute('class', 'ng-binding');
newElem.innerText = '{{text}}';
elem.appendChild(new_elem);
Html:
<h3 id="match-text"></h3>
Maybe this is the totally wrong approach, I don't know. Can someone tell me how to do this properly?