謝謝您的回答很多AWolf。
我找到了簡單的基於密鑰的過濾方法。
請在下面找到參考的小提琴,讓我知道你的意見
<body>
<div ng-app="myApp" ng-controller="myCtrl as mainCtrl">
current filter:
<input ng-model="field" ng-change="mainCtrl.cur" />
<div ng-repeat="x in keys | filter:field">
<p>{{x}} :
<input readonly="" type="text" ng-model="person[x]" class="person" />
</p>
</div>
</div>
</body>
angular.module('myApp', [])
.controller('myCtrl', function MainController($scope) {
$scope.person = {
name: 'Thomas M',
username: 'mthomas',
company: 'XYZ',
email: '[email protected]',
city: 'Philadelphia',
country: 'USA'
};
$scope.keys = Object.keys($scope.person);
});
/* Styles go here */
.person {
border: none
}
感謝 西
Plunker鏈路https://plnkr.co/edit/7NEruSOtUjIWS5ceKe36?p=preview參考這是我目前的工作,並嘗試不同的選擇,以找到解決方案 –