Use ng-show to avoid removing dom elements
Move edge management to it's own service so that it can be accessed elsewhere