Problems with the use of the ui-route AngularJs

0

I'm using SPA I use AngularJS and UI-ROUTE

I want to click on a menu item to write the selected item in a bar that is in the header and not in the ui-view. I can assign the value to a $ scope variable in the controller, but there is no markup on the page

    

<div ng-controller="CtrlHome">
  <h1>Menu</h1>
  <ul >

  <li >
  <a ui-sref="home" class="dropdown-toggle"  data-toggle="dropdown">Home </a>
  </li>

  <li >
  <a ui-sref="pedido" class="dropdown-toggle"  data-toggle="dropdown">Pedido</a>
  </li>

  </ul>

</div>

<div>
  <p>Item Selecionado: {{pagina}}</p>
</div>

     

    
asked by anonymous 21.06.2016 / 18:15

1 answer

0

Move the header into the view , or share the item loaded in view with the header - via service, for example, or (not recommended) $rootScope .

(Post your code so we can suggest implementations based on it.)

    
27.06.2016 / 15:05