Mawg
Mawg

Reputation: 40145

AngularJs radio buttons not working

Should be simple - what am I doing incorrectly?

In my controller:

$scope.eventShow = {tab: 'stations'};

and, in a view:

Show:
<span>
  <label>Stations</label>
  <input type="radio" ng-model="eventShow.tab" value="stations" class="check_box" />
</span>
<span>
  <label>Visitors</label>
  <input type="radio"  ng-model="eventShow.tab" value="visitors" class="check_box" />
</span>

I want the radio buttons to toggle, when one is clicked, and $scope.eventShow.tab to be updated appropriately

Upvotes: 0

Views: 159

Answers (1)

Darin Cardin
Darin Cardin

Reputation: 757

Your code is working correctly for me. what version of angular are you using? I am using this: https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js

or is it possible you do not have ng-controller in the html?

Upvotes: 1

Related Questions