How can I have one checkbox checked by default when the page loads between two toggling check boxes. my code:
jsfiddle: http://jsfiddle.net/Lvc0u55v/456/
function MyCtrl($scope) {
$scope.changeAxis1 = function() {
if ($scope.thirtyDay) {
$scope.wholeTimeline = false;
}
};
$scope.changeAxis2 = function() {
if($scope.wholeTimeline) {
$scope.thirtyDay = false;
}
};
};
view
<label class='checkboxes' id='checkbox_1'>
<input type="checkbox" ng-model="thirtyDay" ng-change="changeAxis1()">
Two
</label>
<label class='checkboxes' id='checkbox_2'>
<input type="checkbox" ng-model="wholeTimeline" ng-change="changeAxis2()">
One
</label>
model=truefor ex.$scope.thirtyDay = true;