JavaScript Angular JS filters working unexpectedly?

I'm trying to filter a list of json data (https://api.myjson.com/bins/5a2aw) using an Angularjs filter. When I just use filter exact matching does not take place and for 1 shows results with id = 1,10,11,12. Using true with filter though works very weirdly, a single result whose id is 7 appears for all ids.

 <html>
    <script src= "http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
    <body>
    <div ng-app="myApp" ng-controller="myCtrl">
    <ul>
    <li ng-repeat="x in names |  filter : true : {id: 7}">
    {{x.Name+ " " + x.Quote}}
    </li>
    </ul>
    </div>
</body>
    <script>
    var app = angular.module('myApp',[])
    app.controller('myCtrl',function($scope, $http){
        $http.get("https://api.myjson.com/bins/5a2aw").success(function(response) {$scope.names=response.records;});
    });
    </script>
</html>
Answer:1

You should put true (which is exact check) after a filter criteria, not at the 1st place of filter.

Markup

<li ng-repeat="x in names |  filter : {id: 7}: true ">
    {{x.Name+ " " + x.Quote}}
</li>

Syntax

{{ filter_expression | filter : expression : comparator}}
Answer:2

I'm new to CSS/Javascript and am having trouble with something that seems like it should be simple. I have a series of radio buttons and corresponding text. I'd like it all to appear as a bullet-...

I'm new to CSS/Javascript and am having trouble with something that seems like it should be simple. I have a series of radio buttons and corresponding text. I'd like it all to appear as a bullet-...

  1. having trouble with netflix
  2. having trouble with hulu
  3. having trouble with facebook
  4. having trouble with instagram
  5. having trouble with memory
  6. having trouble with bowel movement
  7. having trouble with zelle
  8. having trouble with airdrop
  9. having trouble with speech
  10. having trouble with paypal
  11. having trouble with word recall
  12. having trouble with short term memory
  13. having trouble with apple id
  14. having trouble with venmo
  15. having trouble with face id
  16. having trouble with constipation
  17. having trouble with google play services
  18. having trouble with firestick
  19. having trouble with apple pay
  20. having trouble with youtube tv

When coding a MVC 5 view, how do I redirect to a specific action result specifying the controller, action result and a parameter? I am wanting to redirect to this action result in a Dashboard ...

When coding a MVC 5 view, how do I redirect to a specific action result specifying the controller, action result and a parameter? I am wanting to redirect to this action result in a Dashboard ...

  1. redirect action result mvc
  2. redirect to actionresult
  3. redirect action result struts2
  4. struts2 redirect action result example
  5. redirect to actionresult javascript
  6. redirect to another actionresult
  7. actionresult redirect to url
  8. c# redirect to actionresult
  9. actionresult redirect to page

Below is a very simplified version of my problem. Without changing the definition of object "o" and without using the name "obj", how can i refer to obj inside foo. var obj = { foo: function () {...

Below is a very simplified version of my problem. Without changing the definition of object "o" and without using the name "obj", how can i refer to obj inside foo. var obj = { foo: function () {...

Ok. So I'm trying to re create this really cool looking button that I found. The example is at http://gyazo.com/cafe378e8340d71c341b7c52857b2689 See how it is first invisible but now it's faded a ...

Ok. So I'm trying to re create this really cool looking button that I found. The example is at http://gyazo.com/cafe378e8340d71c341b7c52857b2689 See how it is first invisible but now it's faded a ...