如何使用php和angular渲染UI以进行显示和就地更新

<?php

    $ach_json = json_decode ( $ach, true );

    for($i = 0; $i < count ( $ach_json ); $i ++) {
        echo "<ng:switch on='edit'>";

        echo "<div ng:switch-when='true'>";

        $title = $ach_json [$i] ['title'];
        echo "<h3>title $title</h3><br>";
        echo "<input type='image' src='http:'..'  name='edit' value='$i' ng-click='editClick()'>";   
        echo "</div>";
        echo "<div ng:switch-when='false'>";
        echo "Title: <input type='text' ng-model='title' value=$title> <br>";
        echo "<button ng-click='updateRequest()'>update</button>";
        echo "</ng:switch>";
    }
?>
</form>

here I display title, when someone clicks on edit button, I change it to textbox and give the user to update . once someone clicks on update , now I will make a rest call and need to show updated title.