Filtering response exactly and not by similarity


in my API I present a parent list of categories and then I filter the product list by the chosen category.
This is my asset:
response JSON:
{ “name”: “prod1”, “category_id”: “17” },
{ “name”: “prod2”, “category_id”: “7” }

**categories template:**
      <a ng-repeat="categ in categs" href="#/tab/categories/{{}}">
      	<h2>{{ }}</h2>

**product list controller:**
.controller('ProductsCtrl', function($scope, HttpService, $filter, $stateParams) {
    .then(function(response) {
      var category=$filter('filter')(response.products, { category_id: $stateParams.categ_id });

I am getting a weird behaviour:

  1. when I choose the category “17”, I get only the product “prod1” and that’s right
  2. when I choose the category “7” I get both “prod2” and “prod1”, since “prod1”'s category_id CONTAINS "7"
    How could I address this?
    Thanks in advance


Actually it was quite a rookie question…

I (partially) solved by using this syntax:
var category=$filter(‘filter’)(response.products, { category_id: $stateParams.categ_id }, true);