在调试ASP.NET应用程序时如何在Fiddler中显示localhost流量?
我有一些嵌套的对象数据,我想搜索它并根据id返回匹配的对象.
var data = [{id: 0, name: 'Template 0', subComponents:[
{id: 1, name: 'Template 1', subItems:[
{id: 2, name: 'Template 2', subComponents:[{id: 3, name: 'Template 3'}], subItems: [{id: 4, name: 'Template 4'}]}
]}
]}
];
Run Code Online (Sandbox Code Playgroud)
所以我想做这样的事情
getObjectByKeyValue({id: 3})
Run Code Online (Sandbox Code Playgroud)
并让它回来
{id: 3, name: 'Template 3'}
Run Code Online (Sandbox Code Playgroud)
它有点必须完成,因为我有subItems,AND子组件,每个子组件都可以有孩子.
我尝试使用Prototype 1.7并没有运气 - 我认为这只是搜索一个数组,而不是一个带有它的子节点的树:
data.find(function(s){return s.id == 4;})
Run Code Online (Sandbox Code Playgroud)
提前致谢!!!!!!
我的代码中的ng-grid有以下设置:
$scope.gridOptions = {
...
useExternalSorting : false,
}
$scope.watch('gridOptions.ngGrid.config.sortInfo', function (oldValue, newValue) {
console.log(newValue)
})
Run Code Online (Sandbox Code Playgroud)
我也试过用sortInfo : undefined和$watch(gridOptions.sortInfo).这似乎仅在网格最初加载时起作用.之后,当我点击标题列时,它似乎没有进入回调函数$watch.我尝试在回调函数中放置一个调试器来触发排序,我可以看到代码用正确的信息更新sortInfo数组,但是它似乎没有进入watch语句的回调函数.我的设置有什么不对吗?我在这里有一个类似于我正在尝试的东西.
我收到了错误
未知提供商:$ userProvider < - $ user"
使用以下代码:
var app = angular.module('test', []);
app.factory("user", function($scope, $http) {
var usr = {};
usr.getAllLists = function(){
return "test";
}
return usr;
});
cart.controller("MyController", ["$scope", "$http", "$user",
function ($scope, $http, user){
$scope.initialize = function(){
$scope.lists = user.getAllLists();
}
}
]);
Run Code Online (Sandbox Code Playgroud)
你看错了吗?
angularjs ×2
javascript ×2
asp.net ×1
fiddler ×1
localhost ×1
ng-grid ×1
prototype ×1
recursion ×1
tree ×1
web-traffic ×1