Skip to content

Instantly share code, notes, and snippets.

@aaronroberson
Created May 29, 2014 23:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aaronroberson/f3b54850ca37634ebd92 to your computer and use it in GitHub Desktop.
Save aaronroberson/f3b54850ca37634ebd92 to your computer and use it in GitHub Desktop.
Geekwise Day 6 Assets
<div class="three" ng-repeat="item in featuredProducts | limitTo:4" ng-if="!$first">
<ms-featured-product product="item"></ms-featured-product>
</div>
<script src="directives/featured-product-directive.js"></script>
// Check if the current product's guid property is equal to id from the URL
if(product.guid === product_guid) {
// We've found a match, add the matching product to the $scope
$scope.product = product;
}else if(product.isFeatured) {
// Add the featured product to the featuredProducts array
$scope.featuredProducts.push(product);
}
<div class="row">
<!-- add featured here -->
<div class="col-sm-offset-2 col-sm-12 featured">
<div class="small">
<div class="three" ng-repeat="item in featuredProducts | limitTo:3" ng-if="item.guid !== product.guid">
<ms-featured-product product="item"></ms-featured-product>
</div>
</div>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment