简体   繁体   English

Angular.js的路线和局部导航是否适用于复杂导航?

[英]Angular.js routes and partials for complex navigation?

I'm trying to build a fairly sophisticated navigation menu with angular.js. 我正在尝试使用angular.js构建一个相当复杂的导航菜单。 It's going to be very similar to the main drawer navigation here: http://www.purepolaris.com/en-us/snowmobile/Pages/home.aspx 这将与此处的主抽屉导航非常相似: http : //www.purepolaris.com/en-us/snowmobile/Pages/home.aspx

I'm pretty sure I can do this entirely with just routes and partials with maybe some controllers to further break down the content. 我很确定我可以只使用路由和局部控制,而有些控制器可以进一步分解内容。

My question is this - I feel like this is almost too easy and I feel like I'm missing something. 我的问题是-我觉得这简直太容易了,而且我想念一些东西。 What else should I know before I start creating this? 在开始创建此控件之前,我还应该知道什么?

Any help or advice is greatly appreciated. 任何帮助或建议,我们将不胜感激。

DM 糖尿病

Handling nested states with Angular might be very tricky . 用Angular处理嵌套状态可能非常棘手 Angular-UI's Router allows to handle this gracefully, with the dot syntax : Angular-UI的Router允许使用点语法优雅地处理此问题:

$stateProvider
  .state('contacts', {
    templateUrl: 'contacts.html',
    controller: function($scope){
      $scope.contacts = [{ name: 'Alice' }, { name: 'Bob' }];
    }
  })
  .state('contacts.list', {
    templateUrl: 'contacts.list.html'
  });

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM