I am trying to use anular js with symfony2, but i am struggling which integrating Angular to Symfony2
I have following form class in symfony2
public function buildForm(FormBuilder $builder, array $options)
{
$builder
->add('name','text')
->add('address','textarea',array('required'=>false))
->add('city','text')
->add('state','text',array('required'=>false))
}
I am rendering form in twing, following is the code
<form action="{{ path('customer_create') }}" method="post" name="form1" ng-controller="MainCtrl" {{ form_enctype(form) }} >
{{ form_widget(form._token) }}
<div>{{ form_label(form.name) }} {{ form_widget(form.name) }}</div>
<div>{{ form_label(form.email) }} {{ form_widget(form.email) }}</div>
<div>{{ form_label(form.address) }} {{ form_widget(form.address) }}</div>
<div>{{ form_label(form.city) }} {{ form_widget(form.city) }}</div>
<br><br><br> <button type="submit" style="float:left;text-align:left;margin-right:10px">{% trans %}Create{% endtrans %}</button>
</form>
How can i use Angular js in it?
You need to change the Angular JS {{ and }} with something else
check AngularJS-Twig conflict with double curly braces for details