How to work with the Bootstrap DropDown in AngularJS

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:

  1. Bind a dropdown with the controller;
  2. Select an item in the drop down and pass to controller;
  3. Bind a dropdown with the Web API

Bootstrap dropdown

A simple bootstrap dropdown button can be created as shown in the listing below:

image

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:

image 

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:

image

Read full article on the Infragistics blog

Leave a comment

Create a website or blog at WordPress.com