angularjs - Using $routeParams inside ng-repeat filter -
i'm trying pass $routeparams value filter ng-repeat data. here controller:
myapp.controller('bookctrl', ['$scope', '$routeparams' function($scope, $routeparams) { $http.get('books.json').success(function(data) { $scope.books = data; $scope.slug = $routeparams.slug; }); }]); and html:
<div class="container" role="document" ng-repeat="book in books | filter:{slug: {{slug}}}"> <p>{{book.title}}</p> </div> is possible this? try above code, returned syntax error:
problem fixed:
<div class="container" role="document" ng-repeat="book in books | filter:{slug: slug }">
Comments
Post a Comment