我正在渲染一个从父控制器以这种方式传递数据的组件。但是,我收到一个错误,因为撇号被读作最终引用(即
//Sample Object
var data = { "name": "Shelly O'brien", grade: 12}
function template(data) {
return $compile("<node componentdata='" + angular.toJson(data) + "'>
</node>")($scope);
}