AngularJS Example
HTML
<div class="btn-group btn-group-sm" id="buttonGroupNotification">
<button type="button" class="btn btn-primary">✚</button>
<button type="button" class="btn btn-primary">items</button>
<button type="button" class="btn btn-primary" >
✖
</button>
</div>
JavaScript
function Controller($scope) {
$scope.question={};
$scope.question.option={};
//there should be at least two options initially and then user can add more
var option={
number:$scope.question.option.number,
description:$scope.question.option.description,
}
$scope.question.options=[option, option];
$scope.change=function(){
//console.log($scope.question.options);
}
$scope.addOption=function()
{
var option={
number:$scope.question.option.number,
description:$scope.question.option.description,
}
$scope.question.options.push(option);
console.log($scope.question.options);
};
}