Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
In your html do like this:
<super-puper ng-repeat="x in data" ng-if="x != 3"></super-puper>
You can, as @Mikhail Serenkov wrote, or you can remove the template in the directive, or something like that
myApp.directive('superPuper', function() {
return {
restrict: 'E',
replace: true,
link: function($scope, element, attrs) {
var val = $scope.x;
if(val !== 3) {
//Ничего не выводим!!!
var li = angular.element('<li>');
li[0].textContent = val;
element.append(li);
}
}
}
})
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question