Set one item of item group as active in angularjs

To set an item among group of items as chosen or active can be done using a directive. The directive needs to know about which group the item belongs to. So, the group name is passed as parameter to the directive.

Live Demo


Directive parameters:
where, “groupname” is the name of the items group.
where, “module-name” is the name of the namespace the item group is being used in. This is optional parameter, only required when the item group is used multiple times on the same page.

Github repo

Github repo:


The following is the code for the angularjs directive: