javascript - binding radio buttons to ng-model with angularjs -
so relevant part of html-code. tried binding "formfriendsall" scope ng-model.
<form ng-submit="submitform()" > <div class="col-sm-3"> <div class="form-group"> <label>which persons show?</label> <div class="radio"> <label> <input type="radio" name="friendsall" ng-model="formfriendsall" value="friends" > friends </label> </div> <div class="radio"> <label> <input type="radio" name="friendsall" ng-model="formfriendsall" value="alle"> </label> </div> <div>currently selected: {{formfriendsall}}</div> </div> </div><td><input type="submit" class="btn btn-primary" value="los!"/></td> </form>
this relevant js-code:
var challenge = angular.module('challengeapp', []) challenge.controller('challengecontroller', function($scope) { $scope.submitform = function () { alert($scope.formfriendsall); }; $scope.formfriendsall = 'friends'; });
i used alert test change of value when hit submit button tried various methods ng-changed, ng-click, ng-value. nothing helped me solve issue alert , "currently selected" stays on "friends"
any suggestions?
ok guys. seems adminlte.css used in head design of radio buttons blocked angular somehow
Comments
Post a Comment