I need to add an ng-model to every choice in my choice list, so I could watch each choice in angularjs. This is my ChoiceType. I tried adding an attr but it only added it, to the whole list not every choice in the list, I also tried adding a choice_attr but it didn't work.
->add('type', ChoiceType::class, [
'choices' => Type::getChoices(),
'multiple' =>false,
'expanded' =>true,
])
This is my twig file.
<div ng-controller="CreditServiceController">
{{ form_row(form.type) }}
and this is my angular js.
app.controller('CreditServiceController', function ($scope, $timeout) {
$scope.serviceType = "";
$scope.$watch('serviceType', function () {
console.log('hello');
})