I have a JSON string (jsonString).
I will need to format this string, according my template (myTemplate).
Is there a way to make this via JavaScript in AngularJS? Not in HTML!
var jsonString = {
comp_code: 100,
comp_name: 'Test company',
comp_url: 'Some url',
comp_note: 'Some notes',
comp_acc: '1002000'
};
var myTemplate = 'Code: {{comp_code}}, Name: {{comp_name}}, Company account: {{comp_acc}}';
I want a get output string such as this:
'Code: 100, Name: Test company, Company account: 1002000'
jsonStringisn't a JSON string. It's just a JavaScript object.