Lateral Menu making call with Angular!

0

Personal I have a menu and I need to click on a link it appears a content, and when clicking on another link it hides the previous content and displays the new content selected, I am using Angular 1 for particularity of the project .. I have following code but I do not know how to hide one content when another is triggered. Thanks!

<li><span class="glyphicon glyphicon-ok">&nbsp</span>
    <a ng-click="vm.link1 = true">
        Link 1
    </a>
</li> 

<section id="mainContent" class="col-md-9"
    ng-if="vm.link1">
    content 1
</section>
    
asked by anonymous 25.08.2017 / 16:39

1 answer

1

I have already resolved this:

<li><span class="glyphicon glyphicon-ok">&nbsp</span>
    <a ng-click="vm.link = 'link1'">
        Link 1
    </a>
</li>
<li><span class="glyphicon glyphicon-ok">&nbsp</span>
    <a ng-click="vm.link = 'link2'">
        Link 2
    </a>
</li> 

<section id="mainContent" class="col-md-9"
    ng-if="vm.link == 'link1'">
    content 1
</section>
<section id="mainContent" class="col-md-9"
    ng-if="vm.link == 'link2'">
    content 2
</section>

Thank you!

    
25.08.2017 / 16:49