Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/21.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/2/sharepoint/4.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
Angularjs 过滤角路由_Angularjs_Sharepoint_Url Routing_Sharepoint 2013 - Fatal编程技术网

Angularjs 过滤角路由

Angularjs 过滤角路由,angularjs,sharepoint,url-routing,sharepoint-2013,Angularjs,Sharepoint,Url Routing,Sharepoint 2013,我有一个这样的路由基础 { url: /Tasks, templateUrl: /Pages/Tasks.html, nav:1, main:0, isvisible:true }, { url: /Requests, templateUrl: /Pages/Requests.html, nav:2, main:0, isvisible:true }, { url: /Projects, templateUrl: /Pages/Projects.html,

我有一个这样的路由基础

{ url: /Tasks,
  templateUrl: /Pages/Tasks.html,
  nav:1,
  main:0,
  isvisible:true
},
{ url: /Requests,
  templateUrl: /Pages/Requests.html,
  nav:2,
  main:0,
  isvisible:true
},
{ url: /Projects,
  templateUrl: /Pages/Projects.html,
  nav:3,
  main:0,
  isvisible:true
},
{ url: /NewTask,
  templateUrl: /Pages/NewTasks.html,
  nav:1,
  main:1,
  isvisible:true
}....
这是一条很长的路线,就像查找字段一样,引用键是主要的,例如,新任务是任务的子项

我想在控制器中获取它们,首先需要获取主路由,这些主路由的主属性等于0任务、请求、项目,我有一个单击范围,当我单击任务时,我想过滤路由项目,如新闻任务,因为它的主属性等于1。我希望我能说出我的地图

作为一名SharePoint开发人员,我认为这是一个过滤器,我想编写一个查询,如

$route.where(route.main == 0 && isvisible == true).select(url)
主要路线及

$route.where(route.main == 1 && isvisible == true).select(url)
对于任务菜单的子路由

有人能帮忙吗?我是新的角度,但无法想象的路由过滤器


谢谢,真的

我发现我的基本答案很简单。我将在这里为像我这样的初学者写作

$scope.selectTab = function (tabID) {
    $scope.tab = tabID;
    $scope.subMenus = routes.filter(function (route) {
        return route.main === tabID;
    });
}

我不明白你的问题,你能再详细说明一下吗。也许给出一个html和控制器代码或伪代码的具体示例,您是否想过路由json?例如,按主属性引用任务的新任务。它看起来是任务的导航属性