Worked through scoping problem with the ng-switch element. Deleted a lot of old code.