如何使编辑按钮在AngularJS中工作?

如何使编辑按钮在AngularJS中工作?,angularjs,Angularjs,我是AngularJS的新手,我正在创建一个应用程序,在那里我必须编辑文本。我已经创建了按钮。但是,我需要一些帮助来设置编辑按钮。当用户单击编辑按钮时,我希望他们编辑文本 这是我的编辑按钮 编辑 {{people.name} {{people.title}} {{people.date} 维护一个变量编辑,单击编辑按钮即可将其设置为真 根据该变量切换文本和输入 <a class="back" href="#/lawyer">Back</a> <t

我是AngularJS的新手,我正在创建一个应用程序,在那里我必须编辑文本。我已经创建了按钮。但是,我需要一些帮助来设置编辑按钮。当用户单击编辑按钮时,我希望他们编辑文本

这是我的编辑按钮


编辑
{{people.name}
{{people.title}}
{{people.date}

维护一个变量
编辑
,单击编辑按钮即可将其设置为
根据该变量切换文本输入

 <a class="back" href="#/lawyer">Back</a>

       <td><button class="btn btn-primary" ng-click="edit=ture">Edit</button>
    </td>

     <div class="people-view">
     <h2 class="name"><span ng-show="!edit">{{people.name}}</span><input ng-show="edit" value="{{people.name}}"></h2>
     <span class="title"><span ng-show="!edit">{{people.title}}<input ng-show="edit" value="{{people.title}}"></span></span>
     <span class="date"><span ng-show="!edit">{{people.date}} <input ng-show="edit" value="{{people.date}}"></span></span>



      </div>

编辑
{{people.name}
{{people.title}}
{{people.date}

等等,我来做一把小提琴demo@John将ng模型赋予输入,并将一个提交按钮置于该按钮的提交上。调用函数,获取模型值。您能在更新按钮的代码中显示我吗?
 <a class="back" href="#/lawyer">Back</a>

       <td><button class="btn btn-primary" ng-click="edit=ture">Edit</button>
    </td>

     <div class="people-view">
     <h2 class="name"><span ng-show="!edit">{{people.name}}</span><input ng-show="edit" value="{{people.name}}"></h2>
     <span class="title"><span ng-show="!edit">{{people.title}}<input ng-show="edit" value="{{people.title}}"></span></span>
     <span class="date"><span ng-show="!edit">{{people.date}} <input ng-show="edit" value="{{people.date}}"></span></span>



      </div>