阅读背景:

按键事件列表显示在角度js中

来源:互联网 
 <body>
        <div ng-app="mvcapp" ng-controller="AngularController">
            <input type="text" class="myInput form-control" name="txtStorename" id="txtStorename" placeholder="Search for Store.." title="Type in a Store" data-error-message="Please enter StoreName" ng-model="sname"  >
            <ul id="myUL" ng-repeat="StoreList in Store| filter:{StoreName:sname}">
                <li ng-click="SelectedValue(StoreList.StoreName)">{{StoreList.StoreName}}</li>        
            </ul>
            <div ng-show="(Store|filter:sname).length==0" style="color:red;font-weight:bold">No Result Found</div>
        </div>
        <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.js"></script>
        <script>
                var angular = angular.module('mvcapp', []);
                angular.controller('AngularController', function ($scope, $http) {

                        Getallitem()
                        function Getallitem() {

                            $http.get('/Coupons/GetStore').success(function (data) {
                                $scope.Store = data;
                            });
                        }

                    $scope.SelectedValue = function (item) {
                        document.getElementById("txtStorename").value = item;
                    }
                });   
        </script>
    </body>
 <body>
        <div ng-app="mvcapp" ng-control



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: