Skip to content Skip to sidebar Skip to footer

Ng-click Not Working In Chrome But Works In Firefox

I have a NG-Click to change the amount of elements on the page (that are coming from an API call). The NG-Click utilizes a drop down box that works in FireFox. But I recently dis

Solution 1:

You should use ng-change please see here

<bodyng-app="app"ng-controller="AppCtrl"id="body"><divid="main-table"><divclass="widget-body no-padding"><divid="select-more"><selectclass="form-control"name="dt_basic_length"aria-controls="dt_basic"id="box-test"style="width:6%"ng-change="update()"ng-model="selectedItem"><optionvalue="10">10</option><optionvalue="25">25</option><optionvalue="50">50</option><optionvalue="100">100</option><optionvalue="1000">1000</option></select></div><table><tbody><trng-repeat="information in app.info | filter:searchText"><td>{{information.uuid}}</td><td>{{information.publisher}}</td><td>{{information.ts}}</td></tr></tbody></table></div></div>

js:

var app = angular.module('app', []);

app.controller("AppCtrl", function ($http, $scope) {
    var app = this;
    $scope.toLoad = 50;
    $scope.page = 0;
    $scope.sortArray = [];
    $scope.filterList = "";

    $scope.selectedItem = {};

    functiongetData(page) {
        $http.get('/file/filter/' + $scope.toLoad + '/' + $scope.page + '?' + $scope.filterList).success(function (data) {
            app.info = data;
            console.log(data);
        });
    }

    $scope.changeLoad = function (toLoad) {
        $scope.toLoad = toLoad;
        getData($scope.page);
    };

    $scope.update = function () {
      alert($scope.selectedItem);
    };
});

Post a Comment for "Ng-click Not Working In Chrome But Works In Firefox"