Angular newbie here. How would I set up a next/previous button system?

20 views
Skip to first unread message

Tom Tanner

unread,
Mar 11, 2017, 4:06:12 AM3/11/17
to Angular and AngularJS discussion
Hey all,

I'm new to Angular. I've got `index.html` set up like this:

    <div id="cheese-form" class="chart-form-wrapper"> ... </div>
   
<div id="banana-form" class="chart-form-wrapper"> ... </div>
   
<div id="chicken-form" class="chart-form-wrapper"> ... </div>
   
<div id="cookie-form" class="chart-form-wrapper"> ... </div>
   
<div id="next-prev-wrapper">
       
<button>Previous</button>
       
<button>Next</button>
   
</div>


How would I set this up so that `#cheese-form` is the only `div` visible when the page loads? And when you click "Next" it will hide the current `div` and reveal the next one? Vice versa with the "Previous" button. 

Naga Sai A

unread,
Mar 21, 2017, 2:18:56 AM3/21/17
to Angular and AngularJS discussion
Hi Tom,

To achieve expected result, use below option 


Hope this work for you :)


Thanks
Sai

Naga Sai A

unread,
Mar 21, 2017, 2:19:03 AM3/21/17
to Angular and AngularJS discussion

Hi Tom,

To achieve expected result , use below option 


Hope this works for you :)


Thanks
Sai
On Saturday, March 11, 2017 at 3:06:12 AM UTC-6, Tom Tanner wrote:
Reply all
Reply to author
Forward
0 new messages