考虑以下简单的自动完成表单:
<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>
控制器在其他地方定义并负责填充names
和定义onSelect
.
我想在服务器上调用一个 shell 脚本:run_me.sh
使用参数{{selection_made}}
并渲染服务器在客户端上生成的图像。
我怎样才能从 angular + PHP 做到这一点?有一种轻量级的方法吗?