I want to get the option chosen by the person and simply print on the screen (it's just the basics, so I can do what I really want), I just do not know how to do it. The part of the HTML code that has {{value}} is where I want to appear what was selected in the choice box.Obs, I need this information to be able to use in JavaScript code and not in HTML, type of choice do something different in JS ... My code below:
HTML:
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script><scriptsrc="java.js"></script>
</head>
<body ng-app="pag" ng-controller = "botao">
<div ng-repeat = "fig in figuras">
<select>
<option ng-model = "escolha" Ng-repeat = "x in name">{{x}}</option>
</select>
<caixa ng-repeat = "ponto in fig.pontos">
<input type = "text" ng-model="ponto.x" size = "5">
</caixa>
</div>
<div>
<button ng-click="mais()" >Adicionar mais</button>
</div>
valor: {{ valor }}
</body>
</html>
JavaScript:
class Ponto {
contructor(x,y){
this.x = x;
this.y = y;
}
}
class Figura {
constructor(){
this.pontos = [];
this.pontos.push(new Ponto());
this.pontos.push(new Ponto());
}
}
var pag = angular.module('pag', [])
pag.controller('botao',function($scope){
$scope.name = ["Linha","circulo"]
$scope.figuras=[]
$scope.mais = function(){
f1 = new Figura();
$scope.figuras.push(f1);
}
$scope.pontos
})