Skip to content

Instantly share code, notes, and snippets.

@34r7h
Created September 19, 2014 20:31
Show Gist options
  • Save 34r7h/0565c66be0ab992adc0a to your computer and use it in GitHub Desktop.
Save 34r7h/0565c66be0ab992adc0a to your computer and use it in GitHub Desktop.
filters
<p>Parent Article Array: {{ articles }}</p>
<div class="clearfix panel panel-default">
<div class="col-xs-3 panel-body" ng-repeat="article in product.articles track by $index" ng-init="$parent.articles[$index] = article" ng-click="showOptions = true">
<div ng-show="showOptions" ng-click="$parent.removeContentArticles($parent.product.articles, article);">Remove Article</div>
<p>url: {{$parent.api.show.articles.$getRecord(article).articleURL}}</p>
<div ng-if="($index+1) % 4 === 0" class="clearfix"></div>
</div>
</div>
<div class="panel panel-default clearfix">
<h3 class="panel-heading" ng-click="addMoreArticles = !addMoreArticles"><span class="fa fa-photo"></span> Add more articles</h3>
<div class="col-xs-6 panel-body" ng-show="addMoreArticles===true" ng-repeat="article in api.show.articles track by $index">
<div ng-show="$parent.articles[$index] !== article.$id">
<p>article.$id: {{ article.$id }}</p>
<p>$parent.articles[$index]: {{ $parent.articles[$index]}}</p>
<button
ng-click="api.addContentArticles(api.show.articles, article.$id, $parent.product.articles);"
>{{article.articleURL}}</button>
</div>
</div>
</div>
<div ng-if="($index+1) % 5 === 0" class="clearfix"></div>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment