Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.min.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
  <div ng-app="myApp">
    <div ng-controller="myCtrl">
   
    <li ng-repeat="data in MyData | filter: myFilter ">
    {{ data.CompareMessage }}
</li>
    
    </div>
    
  </div>
</body>
</html>
 
var app = angular.module('myApp', []);
app.controller('myCtrl', function ($scope) {
  
    $scope.MyData = [
    {
        "CompareCode" : "A004",
        "CompareMessage" : "test test test, test test test",
    },
    {
        "CompareCode" : "X084",
        "CompareMessage" : "test test test, test test test",
    },
    {
        "CompareCode" : "A1025",
        "CompareMessage" : "test test test, test test test",
    },
    {
        "CompareCode" : "A1",
        "CompareMessage" : "test test test, test test test",
    },
    {
        "CompareCode" : "X52",
        "CompareMessage" : "test test test, test test test",
    },
    {
        "CompareCode" : "A541",
        "CompareMessage" : "test test test, test test test",
    }];
  
    $scope.myFilter = function (word) {
    if(word.CompareCode.charAt(0)=='A'){
      return word.CompareCode;
    }
};
});
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers