         - `index` - {Integer} Item index
 @param {Object} mac-menu-style Styles apply to the menu
 @param {Expression} mac-menu-index Index of selected item
-        - `index` - {Integer} Item index
 ###
 
 angular.module("Mac").directive "macMenu", [

      items:  "=macMenuItems"
      style:  "=macMenuStyle"
      select: "&macMenuSelect"

    link: ($scope, element, attrs, ctrls) ->
      $scope.selectItem = (index) ->

      $scope.setIndex = (index) ->
        $scope.index = index

        if attrs.macMenuIndex?
          $scope.pIndex = parseInt(index)

      # sync local index with user index
      if attrs.macMenuIndex?
        $scope.$watch "pIndex", (value) ->
          $scope.index = parseInt(value)
]
