code to update item
use $rootScope $broadcast