function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sandy1Sandy1 

Can any one help me with

How to use ng-show ,ng-hide ,ng-click in Apex: command Button or Action Function is it possible ?
Steven NsubugaSteven Nsubuga
<apex:page standardController="Contact" extensions="ContactExtAngular">
    <apex:includeScript value="https://ajax.googleapis.com/ajax/libs/angularjs/1.7.2/angular.min.js"/>
    <div ng-app="app" ng-controller="formController">
  <form name="myForm" novalidate="novalidate">
    <table>
    <tr>
        <td>First Name:</td><td><input type="text" name="FirstName" ng-model="contact.FirstName"/></td>
    </tr>
    <tr>
        <td>Last Name:</td><td><input type="text" required="true" name="LastName" ng-model="contact.LastName"/>
        <span class="error" ng-show="myForm.LastName.$error.required">Required!</span></td>
    </tr>
    <tr>
        <td>Mobile Phone:</td><td><input type="text" name="MobilePhone" ng-pattern="/^[0-9 ()-]{0,}[0-9]{1,}$/" ng-model="contact.MobilePhone"/>
        <span class="error" ng-show="myForm.MobilePhone.$error.pattern">Invalid phone!</span></td>
    </tr>
    <tr>
        <td>Email:</td><td><input type="email" name="Email" ng-model="contact.Email"/>
        <span ng-show="myForm.Email.$error.email">This email format is invalid!</span></td>
    </tr>
    <tr>
        <td>Mobile Description:</td><td><textarea type="text" name="Description" ng-model="contact.Description" rows="4" cols="50"/></td>
    </tr>
    </table>
    <input type="button" ng-click="save()" ng-disabled="myForm.$pristine || myForm.$dirty && myForm.$invalid" value="Save"/>
  </form>
</div>

<script>
var app = angular.module('app', []);
app.controller('formController', function ($scope) {
  $scope.contact = {!contactJson};/*{
      FirstName: '{!Contact.FirstName}', 
      LastName: '{!Contact.LastName}', 
      MobilePhone: '{!Contact.MobilePhone}', 
      Email: '{!Contact.Email}', 
      Description: '{!Contact.Description}'
     };*/
  $scope.save = function()
  {
      saveMethod(JSON.stringify($scope.contact));
  }
});

</script>
<apex:form >
<apex:actionFunction name="saveMethod" action="{!save}" oncomplete="location.reload();">
    <apex:param assignTo="{!contactJson}" name="contactJson" value="x"/>
</apex:actionFunction>
</apex:form>
</apex:page>
has ng-show and ng-click
 
Sandy1Sandy1
We not calling angular function here , In action we are calling Apex method from controller right ?