Replacing Elements in Angular

Hi guys,
I’m new to AngularJs and i’m trying to make a user management thing. I want it to list the users and when they are clicked on,
the element turns into an input field and you can edit them and save them. Here
is what i have so far. I don’t quite know what i’m doing. In the directive, I want to make it generic enough so that it could be applied to all
the fields i want to be editable. I give the customer information to editCustomer, but i don’t know how to turn it into an input field that would
be able to do what I want it to do. Can i have some advice on what i should do or how to go about making this sort of thing?

Hi calebbee,

I’ve been having a play around with AngularJS recently too, as it seems to be gaining in popularity. While I didn’t know the answer to your question, I was curious and was able to find a couple of links for you:

The first is a blog post where the author talks about how to do exactly what you’re trying to do, and in the second, he revisits the idea and shows how to turn it into a reusable Angular directive.

Hopefully they should help you solve your problem :slight_smile:

Thanks a lot! This helped