[{
"title" : "Material of the product (indicate the composition or blend ratio of the fabric as a percentage, for functional products include performance or approval certificate) Example: Polyester-75%",
"detail" : [
{
"code" : "0101_0",
"title" : "Material of the product",
"html" : $sce.trustAsHtml("<input type='text' class='form-control' ng-model='details.value'>"),
"value" : ""
},
{
"code" : "0101_1",
"title" : "Functionality",
"html" : $sce.trustAsHtml("<label class='radio-inline'><input type='radio' name='prod' ng-value='Y' ng-model='details.value'>Target Product</label>" +
"<label class='radio-inline'><input type='radio' name='prod' ng-value='N' ng-model='details.value'>Not Target Product</label>"),
"value" : ""
}]}]
Above is a snippet from a Json file that I am attempting to utilize in an angular.js application.
$http.get('/views/online/product/json/01.json').success(function(data) {
$scope.prod_info = data;
}).catch(function (err){
console.log(err)
})
However, I encountered an error because the json file contains JavaScript syntax such as '+' and the $sce.trustAsHtml method.
What is the best way to read a json file with JavaScript language content in angular?