I have created a form in html using angularjs and it is working fine But when i use that same angularjs code into a Yii form it is not giving results. Can anyone tell me what should i do.
I am a new user to Yii and angular. I tried ng-messages and ng-if in my code below:
<div class="control-group">
<?php echo $form->textField($model, 'jobTitle', array('placeholder'=>'JobTitle (eg. Trainee)','ng-model'=>'form.jobTitle','name'=>"jobTitle",'required'=>'required'?> <span class="errorMessage mandatory-star">*</span>
<div ng-messages="jobpost-form.jobTitle.$error" ng-if="interacted(jobpost-form.jobTitle)">
<div ng-message="required">You did not enter a field</div>
</div>
</div>
<div class="control-group">
<?php echo $form->textField($model,'organizationName',array('placeholder'=>'Company (eg. Microsoft)',"name"=>"Company",'required'=>'required')); ?> <span class="errorMessage mandatory-star">*</span>
<div ng-messages="jobpost-form.Company.$error" ng-if="interacted(jobpost-form.Company)">
<div ng-message="required">You did not enter a field</div>
</div>
</div>
<div class="control-group">
<?php echo CHtml::submitButton( 'Post Job',array( 'class'=>'btn highlight-btn bigsize')); ?></div>
But when I run this into browser the ng-message div is disappeared and ng-If code is automatically commented. I have seen this in inspect element.
like this:
<span class="errorMessage mandatory-star">*</span>
<!-- ngIf: interacted(jobpost-form.jobTitle) -->