Currently, I am working with a JSON object that I'm required to use in my project.
const template = require('../../../../assets/jsons/article-tpl.json');
Next, I need to iterate through an array and utilize this object to generate a new template for each iteration based on the specifications outlined in article-tpl.json
.
angular.forEach(content.posts, (value, key) => {
let newTemplate = new Object(template);
// perform actions on newTemplate
// add newTemplate to an array to store all the different templates
}
});
However, I'm encountering an issue where the code is not functioning as expected. Instead of getting a variety of templates in the array, they are all turning out identical. Can anyone assist me in identifying what might be causing this problem? Thank you.