Answer the question
In order to leave comments, you need to log in
How to implement this in AngularJS?
There is a list for example:
<ul class="choiceProducts">
<li class="milkBlock" data-show="milk">Milk</li>
..........................................
$scope.items = [
{kkal:150, class: 'milk', name:'Full-fat milk', value : 100},
{kkal:102, class: 'meatChicken', name:'Low fat milk (1%)', value : 100 },
..............................
$( document ).ready(function() {
$('.choiceProducts li').click(function(){
var chosenCat = $(this).data('show');
$('.listSearch li').hide();
$('.listSearch li.'+chosenCat).show();
});
});
Answer the question
In order to leave comments, you need to log in
To output an array - ng-repeat, and to hide and show elements ng-show and ng-hide.
PS: I could be wrong...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question