I'm trying to generated multiple div dynamically but adding a ng-click
attribute doesn't work.
Here's my code
var div = document.createElement('DIV');
div.className = 'container-car';
var child_div = document.createElement('DIV');
child_div.className = 'carre-car';
child_div.setAttribute("ng-click", "$scope.testCharacter(" + JSON.stringify(unicode) + ")");
var child_paragraphe = document.createElement('P');
var child_text = document.createTextNode($scope.unicode_from_int(unicode['unicode']));
child_paragraphe.appendChild(child_text);
child_div.appendChild(child_paragraphe);
div.appendChild(child_div);
var paragraphe = document.createElement('P');
var text = document.createTextNode(unicode['pinyin']);
paragraphe.appendChild(text);
div.appendChild(paragraphe);
document.getElementById('container-biblio').appendChild(div);
I tried another way like shown in this post but it doesn't seems to work.