fields should be mandatory in Angular ng-template
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2023 11:29 PM
Hello community leadres,
We have created one "Angular ng-template" under the widget to show some pop-up while approver approving the request from serviceportal.This pop-up is to enetring some values before approving the request. Below is the code that i have been used in "Angular ng-template".
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">Please enter Cost & Cost Center details below<button class="glyphicon glyphicon-remove pull-right" ng-click="c.data.closeModal()" style="color:white;background-color: #4CAF50"> <span ></span>
</button></h4>
</div>
<div class="panel-body wrapper-xl">
<form name="modalTemplateS/4" ng-submit="c.data.costs4(c.data.costs41)">
<div class="test">
<label><b>Cost</b></label><input type="test" ng-model="c.data.costs4" name="costs4" ng-required></div>
</form>
<br>
<form name="modalTemplateS/4" ng-submit="c.data.costs3(c.data.costs31)">
<div class="test">
<label><b>Cost Center</b></label><input type="test" ng-model="c.data.costs3" name="costs3" ng-required></div>
</form>
<br>
<button type="button" name="submit" class="btn btn-default btn-question" ng-click="c.data.close(c.data.costs41)" style="color:white;background-color: #4CAF50">Submit</button>
<font color="red"><span ng-if="c.data.costs4 == false">***Please enter Cost***</span></font>
</div>
</div>
Now, this pop should not allow to submit without entering those cost & costcentere details. I have tried by using ng-required however it is not working.Please help here.
Thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2023 12:59 AM
Hi ,
Try ng-required="true".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2023 01:18 AM
Hi,
Or try to add only required> word at last .