got the resource lookup working nicely as a self contained directive