O'Reilly logo

Learning Web Development with Bootstrap and AngularJS by Stephen Radford

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Update

As you'll recall, we didn't create a view exclusively to edit our contacts. We can either use the same partial we used to add contacts, or alternatively do something a little more fun with the single-contact view and create our own directive to edit the data.

It's unlikely that you'll ever want to edit all aspects of a contact at once; often, it's only a phone number or email address that's changed. I like the idea of displaying our text alongside a little Edit button. When clicked, this will allow us to edit this section of the contact.

Let's call the directive editable and start it up exactly as we did before:

.directive('editable', function(){
    return {

    };
})

Again, I think it's wise to allow the choice of including this as a custom element ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required