I have 5 buttons using the same ng-click function. Basically each of the buttons operate similarly to a tabbed navigation, where you click one of the buttons and it takes you to that tab's pane. Each of these buttons can be repeatable and are housed in a template. The tab panes are also all in a template but aren't all active until a user clicks one of the buttons and creates a page. So basically there are multiple click functions nested within click functions that do different things depending on what user has activated.
In jQuery, I could just use "this" and select the object that was clicked and do all my manipulations to that object easily; however, it doesn't appear there's a way to do that using just angular. Currently, when you click one of these buttons it does the same thing to all of them. I figure I could create 5 separate functions, but I don't want to do that for scalability reasons.
So to summaraize:
- Is there a way to select "this" in Angular?
- I'd like a solution that is just using Angular and no jQuery
Is there an efficient way of dealing with click functions within click functions?
<nav class="block--menu"> <section class="content--menu" ng-controller="ActiveCtrl"> <div class="menu" > <button class="menu__item" ng-click="showConfirm()"></button> <button class="menu__item" ng-click="showConfirm()"></button> <button class="menu__item" ng-click="showConfirm()"></button> <button class="menu__item" ng-click="showConfirm()"></button> <button class="menu__item" ng-click="showConfirm()"></button> </div> </section>