Firstly, yes, I tried Google search, but it is still hard to find information about AngularJS.
I want to create a simple task to open sections based on which button is clicked on the form. I want only one section to be open at any time and possibly by default (not decided). It would also be nice if the button you click is classified as "btn-primary" for bootstrapping. So this is html
<form> <input type="button" id="show-section1" value="Section 1" /> <input type="button" id="show-section2" value="Section 2" /> <input type="button" id="show-section3" value="Section 3" /> </form> <section id="section1">blah</section> <section id="section2">blah2</section> <section id="section3">blah3</section>
In jQuery, I would do something like this (simplified and not the best solution to explain):
$('section').hide(); $('#show-section1').click(function() { $('section').hide(); $('#section1').show(); }); etc
I did this once before, but I canโt remember how, as I recall, it was very few lines of code.
source share