Show article from category mean.js

12 views
Skip to first unread message

Marcos Santana

unread,
Dec 3, 2016, 10:17:32 PM12/3/16
to nodejs
Link Menu

<a ui-sref="articles.list-nav({category: category.name})">
  {{ category.name }}
</a>

Route Client:

.state('articles.list-nav', {
        url
: '/:category/articles',
        templateUrl
: 'modules/articles/views/list-articles-scategory.client.view.html',
        controller
: 'ArticlesController'
     
})

List Article Category:

<a class="md-12-line" ng-repeat="article in getArticles(category.id) ">
Controller Client:

$scope.getAticles = function(category){
             
var result = [];
             
for(var i = 0 ; i < $scope.articles.length ; i++){
                 
if(category === $scope.articless[i].category){
                     result
.push($scope.articles[i]);
                 
}
             
}
             console
.log(category);
             
return result;
         
};

I tried the other way:

Controller Client:

 $scope.subCat = $stateParams.subcategoria;

List Article Category:

<a class="md-12-line" ng-repeat="article in article | Filter: {(category: category.id)} ">

But not working anyway, can I help me?

Paul Spaulding

unread,
Dec 6, 2016, 12:05:48 PM12/6/16
to nodejs
This looks like an AngularJS question.
Reply all
Reply to author
Forward
0 new messages