1

I am rendering a component passing down data this way from a parent controller. However, I am getting an error because apostrophes are being read as the end quote (i.e.

//Sample Object
var data = { "name": "Shelly O'brien", grade: 12}

 function template(data) {
      return $compile("<node componentdata='" + angular.toJson(data) + "'>
      </node>")($scope);
    }
AT82
  • 71,416
  • 24
  • 140
  • 167
Eva
  • 11
  • 3

0 Answers0