0

I have a dynamic HTML page. One element (textarea) is generated via php (third party library) and I can't set ng-model for it. Can I setup ng-model for textarea after initialization, maybe jQuery callback or something similar.

Aravind
  • 40,391
  • 16
  • 91
  • 110
Avirtum
  • 438
  • 6
  • 14
  • 1
    any specific reason for generating the element through php? – Aravind Nov 15 '16 at 09:11
  • 1
    to add on to what Aravind said: there's probably a way to cobble something together, but taking the textarea out of php's hands and implementing the whole frontend in angular will save you a lot of pain – Kai Nov 15 '16 at 09:20
  • have you tried calling $compile, after adding ng-model – MeanMan Nov 15 '16 at 09:35
  • I'm looking for a solution how to resolve this issue. First look told me I can't modify this php callback (it's generated tinyMCE editor), but maybe I wrong. – Avirtum Nov 15 '16 at 09:37
  • You guess I should call $compile for whole page after markup is done? Before that I should also add ng-model attribute to my textarea I think. – Avirtum Nov 15 '16 at 09:40
  • I found a solution. I use this code ob_start(); ob_get_contents(); and ob_end_clean();, than I modify textarea with my attributes with ng-model. Works good as I see. – Avirtum Nov 15 '16 at 10:11

0 Answers0