Skip to content

Instantly share code, notes, and snippets.

@mchelen
Last active November 29, 2017 19:16
Show Gist options
  • Select an option

  • Save mchelen/d0ee65d9f6089faa8200982de1032f21 to your computer and use it in GitHub Desktop.

Select an option

Save mchelen/d0ee65d9f6089faa8200982de1032f21 to your computer and use it in GitHub Desktop.
$scope.products = [
'product1' = {
title = 'Product 1',
links = 'linksA',
}
'product2' = {
title = 'Product 2',
links = 'linksB',
}
'product3' = {
title = 'Product 3',
links = 'linksA',
}
];
$scope.linksA = [
{url: 'example.com'},
{url: 'google.com'},
];
$scope.linksB = [
{url: 'yahoo.com'},
];
<div ng-repeat="product in products">
<h2>{{product.name}}</h2>
<div ng-repeat="link in this[product.links]">
<a href="{{link.url}}">Click Here</a>
<div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment