First sorry about my english i will do my best to explain. I recently started a project what will use heavy javascript, specially lot of ajax calls and ajax manipulations.
For example lke
- facebook style dropdown notification
- lot of different ajax forms
- like button
- follow button
- image manupulations and uploads
I made similar with jQuery back in time and jQuery is the only library i know yet. But i was eyeing with AngularJs studied a lot about it and i am likeing it.
I was searching for Laravel + AngularJs tutorial but did not find any useful information for my answer.
So when i use jQuery for example, and i would like to retrive data from an attribute, or sending a form, i have to give it a class
or id
, but angular uses controllers.
So my question is it okay to mix the controllers with the view?
Example
<?php echo Form::open() ?>
<?php echo Form::label('password', 'Password') ?>
<?php echo Form::password('password', array('class' => 'span4')) ?>
<span class="help-block">5-12 characters.</span>
<?php echo $errors->has('password') ? $errors->first('password', '<p class="validation-error">:message</p>') : ''?>
<?php echo Form::label('confirm_password', 'Confirm password') ?>
<?php echo Form::password('confirm_password', array('class' => 'span4')) ?>
<?php echo $errors->has('confirm_password') ? $errors->first('confirm_password', '<p class="validation-error">:message</p>') : ''?>
<div ng-controller="PhotoCtrl">
//on image change preform auto upload
</div>
<?php echo Form::button('Sign up', array('class' => 'btn btn-block btn-success')) ?>
<?php echo Form::close() ?>
So in the above code what i posted, you see the ng-controller, mixing the 2 this way is good or bad?
Thank you