Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/373.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Ng视图未给出输出“;RangeError:超过最大调用堆栈大小;_Javascript_Angularjs - Fatal编程技术网

Javascript Ng视图未给出输出“;RangeError:超过最大调用堆栈大小;

Javascript Ng视图未给出输出“;RangeError:超过最大调用堆栈大小;,javascript,angularjs,Javascript,Angularjs,Ng视图未给出输出。试图一页一页地从一个页面路由到另一个页面,但我得到了这个错误 “RangeError:超过最大调用堆栈大小” 请检查以下内容,并给出克服此问题的建议。 App.jss "严格使用", var app = angular.module('Sab', ['ui.filters','ui','ngRoute']) .config(["$routeProvider", function($routeProvider) { $routeProvider. when

Ng视图未给出输出。试图一页一页地从一个页面路由到另一个页面,但我得到了这个错误

“RangeError:超过最大调用堆栈大小”

请检查以下内容,并给出克服此问题的建议。 App.jss

"严格使用",

var app = angular.module('Sab', ['ui.filters','ui','ngRoute'])

.config(["$routeProvider", function($routeProvider) {
    $routeProvider.
      when('/home', {
          templateUrl: 'index.html',
          controller: 'menuCtrl'
      }).
      when('/Deals/:offer_name', {
          templateUrl: 'Deals.html',
          controller: 'abCtrl'
      }).
      when('/D', {
            templateUrl: 'D.html',

      }).
      otherwise({
          redirectTo: '/home'
      });
}])


.controller('menuCtrl', function($scope,$http) {


     $http.get("http://tools.vcommission.com/api/coupons.php?apikey=e159f64e3dd49fddc3bb21dcda70f10c6670ea91aac30c7cb1d4ed37b20c45b8").then(function (response) {
      $scope.myData = response.data;
      $scope.offerName = ''; //set initially
      $scope.selectedIndex = -1;
      $scope.filteredOffers = [];



  });
 $scope.showData = function(offer_name, index) {
        $scope.offerName = offer_name;
      $scope.filteredOffers = $scope.myData.filter(function(offer) {
        return offer.offer_name == $scope.offerName;
      });
        $scope.selectedIndex = index;

      }


})

.controller('abCtrl',function($scope,$http,$stateParams,$filter,$window) {


$http.get("http://tools.vcommission.com/api/coupons.php?apikey=e159f64e3dd49fddc3bb21dcda70f10c6670ea91aac30c7cb1d4ed37b20c45b8").then(function (response) {


      var offerName = $stateParams.offer_name;
      $scope.filteredOffers = $filter('filter')(response.data, {offer_name: offerName});
    //  $scope.filteredOffers = _.filter(response.data, ["offer_name",offerName]);

      console.log($scope.filteredOffers)
      console.log(offerName)


      $scope.dealopen = function($a){
            for (var i=0;i<response.data.length;i++)
        {
            //console.log($scope.data[i].name);
            $link=response.data[i].link;

            if ($link==$a)
            {

            $window.open($link,"_self","location=yes"); 
            console.log($a);
            }




        }



        }
      });


});
var-app=angular.module('Sab',['ui.filters','ui','ngRoute']))
.config([“$routeProvider”,函数($routeProvider){
$routeProvider。
当(“/home”{
templateUrl:'index.html',
控制器:“menuCtrl”
}).
当(“/Deals/:offer_name”{
templateUrl:'Deals.html',
控制器:“abCtrl”
}).
当('/D'{
templateUrl:'D.html',
}).
否则({
重定向到:'/home'
});
}])
.controller('menuCtrl',函数($scope,$http){
$http.get(“http://tools.vcommission.com/api/coupons.php?apikey=e159f64e3dd49fddc3bb21dcda70f10c6670ea91aac30c7cb1d4ed37b20c45b8)然后(函数(响应){
$scope.myData=response.data;
$scope.offerName='';//初始设置
$scope.selectedIndex=-1;
$scope.filteredOffers=[];
});
$scope.showData=函数(提供名称、索引){
$scope.offerName=要约名称;
$scope.filteredOffers=$scope.myData.filter(函数(提供)){
return offer.offer_name==$scope.offerName;
});
$scope.selectedIndex=索引;
}
})
.controller('abCtrl',函数($scope、$http、$stateparms、$filter、$window){
$http.get(“http://tools.vcommission.com/api/coupons.php?apikey=e159f64e3dd49fddc3bb21dcda70f10c6670ea91aac30c7cb1d4ed37b20c45b8)然后(函数(响应){
var offerName=$stateParams.offer\u name;
$scope.filteredOffers=$filter('filter')(response.data,{offer_name:offerName});
//$scope.filteredOffers=\uu.filter(response.data,[“offer\u name”,offerName]);
console.log($scope.filteredOffers)
console.log(offerName)
$scope.dealopen=函数($a){

对于(var i=0;i首先,我想到了无限递归。首先,您的
menuCtrl
被加载两次:

  • 在html中

    ng-controller="menuCtrl"
    
  • 途中

    when('/home', {
      templateUrl: 'index.html',
      controller: 'menuCtrl'
    })
    

  • 让我们从解决这个问题开始。下一个问题取决于您的其他html模板。

    您调用的数据非常大。它是一个2 MB的数组。这可能与“超出了最大调用堆栈”有关.但这在爱奥尼亚很管用..如何克服它看起来不像是连接到大数据上的。更多的看起来像是无限嵌套路由或其他某种无限递归。你能给我们一把小提琴吗?是的,我们能。怎么做?Skype?我在gmail在bhatnagarabhi2411@gmail.com在TeamViewer上,你可以在哪里检查
    when('/home', {
      templateUrl: 'index.html',
      controller: 'menuCtrl'
    })