using resolve promise in order to load data on controller before rendering html view