I'm a beginner with Angular JS and after some research, it seems like what I want to achieve might not be possible. However, I'd like to explore if there is an alternative solution that can provide a similar outcome.
My goal is to populate a page using data from a JSON file, and dynamically load a customized list item using the URL specified in that JSON file. Here's an example:
JSON (inside controller):
function ExCtrl($scope) {
$scope.examples = [
{name:"example",
num: 1,
url:"website.html"}
];
}
JS (inside HTML):
<ul ng-controller="ExCtrl">
<li ng-repeat="example in examples">
<div ng-include src="folder/{{example.url}}> </div>
</li>
</ul>
Solution :
<ul ng-controller="ExCtrl">
<li ng-repeat="example in examples">
<div ng-include src="example.url"> </div>
</li>
</ul>
Current code snippet:
function ExCtrl($scope) {
$scope.examples = [
{name:"example",
num: 1,
url:"folder/website.html"}
];
}