fixed error when navigating to postview state and fixed ui-sref in template