angularjs - add an ng-model to ng-click that passes true false params -
i have button
<a class="btn btn-primary" ng-click="isprivate = !isprivate"> {{isprivate ? "make event public" : "make event private"}} </a>
i'm wanting have button once clicked passes true false controller. i've tried this
<a ng-model="event.public" class="btn btn-primary" ng-click="isprivate = !isprivate"> {{isprivate ? "make event public" : "make event private"}} </a>
any ideas im doing wrong?
heres code in controller
$scope.event.public = '';
i've found out can checkbox
<input type="checkbox" id="public" ng-click="isprivate = !isprivate" ng-model="event.public" ng-true-value="'yes'" ng-false-value="'no'">
i'd prefer being button though rather checkbox
Comments
Post a Comment