I have an app in angular but I have the next mess.
The menu of the app is blank and after logging in it calls a function that brings the menu enabled for the user. The problem is that the menu is not updated, it is as if the ng-repeat did not take the change suffered by the scope.
How could I correct it? I'm using Angular-Material
<div class="md-toolbar-tools">
<md-button class="md-icon-button" aria-label="Settings">
<md-icon>menu</md-icon>
</md-button>
<h2><span>Inspecciones</span></h2>
<span flex></span>
<md-menu ng-repeat="menu in vm.menu">
<md-button md-menu-origin ng-click="$mdOpenMenu()">{{menu.title}}</md-button>
<md-menu-content>
<md-menu-item ng-repeat="subm in menu.subm">
<md-button ng-href="#/consultaInspector">{{subm.name}}</md-button>
</md-menu-item>
</md-menu-content>
</md-menu>
</div>
This is the function that the Menu brings me.
function menus() {
if (OrganismosService.authentication.isAuth != false) {
MenuService.ConsultaMenus(OrganismosService.authentication.userName)
.then(function (data) {
vm.menu = data;
})
}
}