JSFiddle - React, Tailwind, and code Playground
by yazaki
HTML
<div ng-app="myapp" ng-controller="myctrl">
<input type="text" ng-model="filter_text">
<ul>
<li ng-repeat="item in items | myfilter:filter_text">
{{item}}
</li>
</ul>
</div>
JavaScript
angular.module('myapp', []).filter('myfilter', function(){
return function(input, text){
return input.filter(function(item){
return item.startsWith(text);
});
};
});
function myctrl($scope){
$scope.filter_text = 'a';
$scope.items = [
'abc',
'bca'
];
}