search

Home  >  Q&A  >  body text

angular.js - angularjs实现点击事件后,在firefox生效却在360浏览器不起作用

在学习angularjs的过程中,做了一个选择区域的小练习
实现后在不同浏览器居然无法实现功能

<h5 class="titright">选择区域:</h5>
        <select name="addressid1" ng-model="query">
            <option value="no">请选择</option>
            <option  value="{{phone.provinceid}}" ng-repeat="phone in phones" ng-click="getcity()">{{phone.province}}</option>
        </select>
        <select name="addressid2" ng-model="mycity" ng-show="num=='1'">
            <option value="no">请选择</option>
            <option value="{{phone.cityid}}" ng-repeat="phone in city| filter:query" ng-click="getareas()">{{phone.city}}</option>
        </select>
        <select name="addressid3" ng-show="num1=='1'">
            <option value="no">请选择</option>
            <option value="{{phone.areaid}}" ng-repeat="phone in areas| filter:mycity" >{{phone.area}}</option>
        </select>

这是js

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



phonecatApp.controller('PhoneListCtrl', ['$scope', '$http', function($scope, $http) {
  $http.get('json/map_provinces.json').success(function(data) {
    $scope.phones = data;
    $scope.query="120000";
    $scope.num=0;
    $scope.num1=0;
  });
        
    $scope.getcity=function(){
        $http.get('json/map_city.json').success(function(data) {
        $scope.num=1;
        $scope.num1=0;
        $scope.city = data;
        $scope.mycity="no";
      });
    };
    $scope.getareas=function(){
        $http.get('json/map_areas.json').success(function(data) {
        $scope.num1=1;
        $scope.areas = data;
        $scope.myareas="no";
      });
    };
  //$scope.orderProp = 'age';
}]);

在360浏览器中

在firefox浏览器中

伊谢尔伦伊谢尔伦2744 days ago665

reply all(3)I'll reply

  • 我想大声告诉你

    我想大声告诉你2017-05-15 16:58:34

    Use Ng-change in select

    reply
    0
  • 我想大声告诉你

    我想大声告诉你2017-05-15 16:58:34

    Is it a problem with IE version? Only Angular1.2-supports IE8.

    reply
    0
  • 天蓬老师

    天蓬老师2017-05-15 16:58:34

    The context is unclear, such as the version of ng, whether the 360 ​​is currently in speed mode or compatibility mode, whether there are any errors in the console, etc.
    What the first floor said is correct, it should be in the <select>中使用ng-changecommand

    reply
    0
  • Cancelreply