Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I have problem with my data array contains alphabets.

I am using ng-repeat to display data of alphabets. I have following array of alphabets in my scope.

$scope.alphabets = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'];

In HTML file i am using code of button to display Alphabets.

<button ng-repeat="alphabet in alphabets" class="btn btn-danger" style="margin:0 3px 3px 0;width:70px;" ng-click="selectOpt(alphabet, $index)">{{alphabet}}</button>

It displays the Alphabets accurately. Problem is that after loading Alphabets the $scope.alphabets array become empty. I figure out this buy debugging. Also after clicking any button the whole Alphabets buttons disappears.

share|improve this question
    
It's possible to create a live demo, or post more code? –  R3tep 34 mins ago
1  
post your selectOpt function –  j.wittwer 23 mins ago
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.