0

I have two radio buttons:

<div class="btn-group" data-toggle="buttons">
    <label class="btn btn-primary active">
        <input type="radio" name="options" id="server" 
               autocomplete="off" checked ng-model="app.callback_url" 
               ng-change="patchApp({callback_url:app.callback_url},app.callback_url)">
        Server-side Callback
    </label>
    <label class="btn btn-primary">
        <input type="radio" name="options" id="client" autocomplete="off" 
               ng-model="app.callback_url" 
               ng-change="patchApp({callback_url:app.callback_url},app.callback_url)"> 
        Client-side Callback
    </label>
</div>

They should be triggering a patchApp function: ng-change="patchApp({callback_url:app.callback_url},app.callback_url)

However, they do not. I've also tried ng-click="patchApp({callback_url:app.callback_url},app.callback_url) and that did not trigger the function either.

Any idea where I'm going wrong? It works just fine for a dropdown:

<select class="form-control col-md-7 col-xs-12" name="platform" 
        ng-model="app.platform" ng-change="patchApp({platform:app.platform},app.platform)">
    <option value="ios">iOS</option>
    <option value="android">Android</option>
    <option value="unity">Unity</option>
</select>

1 Answer 1

2

You're missing ng-value. That is why your model is not getting assigned any values and ng-change is not triggered.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.