阅读背景:

在angularjs中使用列表中的键盘快捷键

来源:互联网 
<html>
<body>
    <div ng-app="mvcapp" ng-controller="AngularController">
        <input ng-keyup="obj.showList = true;" 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 ng-if="obj.showList" id="myUL" ng-repeat="StoreList in Store| filter:{StoreName:sname}">
            <li ng-click="SelectedValue(StoreList.StoreName)" ng-cloak>{{StoreList.StoreName}}</li>
        </ul>
        <div ng-show="(Store|filter:sname).length==0" style="color:red;font-weight:bold" ng-cloak>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) {

        $scope.obj = {};
        $scope.obj.showList = false;
                    Getallitem()
                    function Getallitem() {

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

                $scope.SelectedValue = function (item) {
                    $scope.sname = item;
                    $scope.obj.showList = false;

                }
            });
    </script>
</body>
<html>
<body>
    <div ng-app="mvcapp" ng-contr



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

分享到: