Read full article on the Infragistics blog
In this post we will learn how to work with the Bootstrap dropdown in an AngularJS APP. In a step by step by approach, we’ll cover how to:
- Bind a dropdown with the controller;
- Select an item in the drop down and pass to controller;
- Bind a dropdown with the Web API
Bootstrap dropdown
A simple bootstrap dropdown button can be created as shown in the listing below:
In the dropdown we’ve created above, we will be navigated to another view or page on selecting an item and all the items are hard coded in the dropdown.
Bootstrap dropdown with AngularJS controller data
Now let us assume that we need to create a bootstrap dropdown in the AngularJS application. To create that, first we need to make sure that the reference of bootstrap CSS is added in the project, as shown in the listing below:
Next let us create AngularJS controller. In the controller there is an array called subjects which will be bound to the bootstrap dropdown. The controller can be created as shown in the listing below:
Leave a Reply