많은 방법으로이 질문을 달성하기 그러나 나는 총 각도 solution.Below 내가 당신의 질문에서 이해 무엇을 기반으로 HTML 템플릿입니다 선호 할 것입니다.
드롭 다운에서 값을 선택하는 순간 ng-model 값은 사용자가 만든 필터에서 대문자로 바뀝니다.
HTML
<div role="main" class="container theme-showcase" ng-app="angularTable">
<div class="" style="margin-top:90px">
<div class="col-lg-8">
<div class="page-header"></div>
<div class="bs-component" ng-controller="listdata">
<select ng-options="x.username as x.username for x in users" ng-model="myModel" ng-change="optionChanged()"></select>
{{myModel | makeUppercase }}
</div>
</div>
</div>
</div>
JS
// Code goes here
var app = angular.module('angularTable', []);
app.controller('listdata', function($scope, $http) {
$scope.users = [];
$scope.myModel;
$http.get("demo.json").success(function(response) {
$scope.users = response;
console.log($scope.users);
});
$scope.optionChanged = function() {
console.log("options have been changed..");
};
});
app.filter('makeUppercase', function() {
return function(item) {
if (item) {
console.log(item)
return item.toUpperCase();
}
};
});
나는 단지를 트리거 할
작업 DEMO. @ 31piy – venura
@ 31piy plz help – venura