<!--

    Copyright (C) 2015 The Gravitee team (http://gravitee.io)

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

            http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<hr ng-if="$ctrl.reducedMode"/>

<md-list-item ng-if="!$ctrl.reducedMode && $ctrl.submenuItems.length > 0">
  <h4>{{$ctrl.sidenavService.getCurrentResource()}}</h4>
</md-list-item>

<md-list-item ng-repeat="menuItem in $ctrl.submenuItems track by menuItem.name">
  <a
    ui-sref="{{ :: menuItem.name }}"
    ui-sref-active="sidenav-active"
    title="{{ :: menuItem.data.menu.label }}">
    <ng-md-icon icon="{{ :: menuItem.data.menu.icon }}"></ng-md-icon>
    <span ng-if="!$ctrl.reducedMode">{{ :: menuItem.data.menu.label}}</span>
  </a>
</md-list-item>

<!--

    Copyright (C) 2015 The Gravitee team (http://gravitee.io)

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

            http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<hr ng-if="$ctrl.reducedMode"/>

<md-list-item ng-if="!$ctrl.reducedMode && $ctrl.submenuItems.length > 0">
  <h4>{{$ctrl.sidenavService.getCurrentResource()}}</h4>
</md-list-item>

<md-list-item ng-repeat="menuItem in $ctrl.submenuItems track by menuItem.name">
  <a
    ui-sref="{{ :: menuItem.name }}"
    ui-sref-opts="{reload: true}"
    ui-sref-active="sidenav-active"
    title="{{ :: menuItem.data.menu.label }}">
    <ng-md-icon icon="{{ :: menuItem.data.menu.icon }}"></ng-md-icon>
    <span ng-if="!$ctrl.reducedMode">{{ :: menuItem.data.menu.label}}</span>
  </a>
</md-list-item>

Refresh API when changing screen
fix(api): Refresh API when changing screen

Closes gravitee-io/issues#519
