Updating a table that I have used ng-repeat in

565 views
Skip to first unread message

Marie

unread,
Nov 29, 2012, 5:39:26 PM11/29/12
to ang...@googlegroups.com
Hey guys,

I have a table that I have populated with ng-repeat and I have created a delete user function.
So as of now I have to hit the refresh button to see the changes.
I have s noSQL db and I am fetching the data with a http request.

I was wondering if there is some "best practice" or a special way to  update my table?

And If anyone was wondering, yes,  I am quite new to JS and even newer to Angular ;)

Have a nice evening!

Marie

unread,
Nov 29, 2012, 5:46:46 PM11/29/12
to ang...@googlegroups.com
I meant that when I delete a user, I have to reload in order to see the table changes.

Josh Kurz

unread,
Nov 29, 2012, 5:56:05 PM11/29/12
to ang...@googlegroups.com, ang...@googlegroups.com
You can just splice the user from the scope array after you delete the user to represent the change in the db. 

Array.splice($index,1)

Sent from my iPhone
--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To post to this group, send email to ang...@googlegroups.com.
To unsubscribe from this group, send email to angular+u...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular?hl=en-US.
 
 

Marie

unread,
Nov 30, 2012, 3:04:44 PM11/30/12
to ang...@googlegroups.com
Thanks! It worked perfectly :) Appreciate the help.
Reply all
Reply to author
Forward
0 new messages