简体   繁体   中英

Angular.js routes and partials for complex navigation?

I'm trying to build a fairly sophisticated navigation menu with 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

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-UI's Router allows to handle this gracefully, with the dot syntax :

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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