Consider the following simple autocomplete form:
<html>
...
<body>
...
<div class='container-fluid' ng-controller="TypeaheadCtrl">
<input type="text"
ng-model="selected" typeahead="name for name in names | filter:{name: $viewValue} | limitTo:8"
typeahead-on-select='onSelect($item, $model, $label)'
class="form-control">
You made this selection {{selection_made}}.
<!-- Run "run_me.sh {{selection_made}} on the server-->
<!-- Render the image that run_me.sh saves to disk on the server --!>
<img ng-src=image.png/>
</div>
<body>
</html>
Where the controller is defined elsewhere and is in charge of populating names
and the definition of onSelect
.
I would like to invoke a shell script on the server: run_me.sh
with arguments {{selection_made}}
and render the image that the server generates on the client.
How can I do this from angular + PHP ? Is there a lightweight approach to this?