1
Hello!
I got these radio Buttons:
<div class="row" ng-controller="GetDados">
<div class="col-lg-10 col-lg-offset-5">
<label class="radio-inline">
<input type="radio" name="optradio" ng-bind="pizza">Pizza
</label>
<label class="radio-inline">
<input type="radio" name="optradio" ng-bind="barras">Barras
</label>
</div>
</div>
that’s the idea..
Edit:
What I need is that when choosing a radio button the angular perform an action, such as displaying a chart through $Scope
Edit:
I tried this, it worked:
<div class="row" ng-controller="GetDados">
<div class="col-lg-10 col-lg-offset-5">
<label class="radio-inline">
<input type="radio" name="optradio" ng-click="pizza()" >Pizza
</label>
<label class="radio-inline">
<input type="radio" name="optradio" value="barra()" >Barras
</label>
</div>
</div>
app.controller('GetDados', function($scope, $http){
$http.get('http://localhost/api/v1/index.php/dados').
success(function(data){
$scope.dados = data;
});
$scope.pizza = function() {
console.log("oi");
}
});
What error shows on console? Format your question, there is a part of the code that went wrong
– André Vicente
Edited question
– novato
Why don’t you use ng-Click and put your function to run?
– Gabriel Rodrigues
that’s what I tried...
– novato
"I tried this, it worked:". So that’s good. Because you’re asking?
– leopiazzoli