Implementing the user View
For the user view, Listing 26.13 implements two simple forms. The first allows you to modify the email and color preferences of the user. The body contains a <div> element that creates an instance of an AngularJS controller that gets the user information from the webserver. The username <input> element is set to disabled to prevent the user from changing the username.
Notice that the inputs are bound to the $scope.user value in the AngularJS scope by using ng-model. Also notice that the form methods are POST but also include the action attribute, which specifies the route to use to save or delete the user. Remember that using the action attribute overrides the AngularJS suppression of the normal <form> functionality. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access