JSFiddle - React, Tailwind, and code Playground
HTML
<body ng-app="myApp">
<div ng-controller="parentCtrl">
<form action="http://asamplesite.com" method="POST" name="myForm">
<input type="text" ng-model="message" />
<input type="submit" value="submit"/>
</form>
<button ng-click="setAction()">Set Action</button>
</div>
</body>
JavaScript
angular.module('myApp', [])
.controller('parentCtrl', ['$scope', function($scope){
$scope.setAction= function(){
document.myForm.action='http://www.google.com';
};
}]);