I have a JSON object returning from a httpq call. One of the properties is LinkUrl. Sometimes this will have a predetermined url that comes from the returned object, other times it will just have a file name in which I'll need to prepend a base url to the beginning of that file name.
Not sure if there is a more angular way to do this or if it needs to be a regex if statement.
Below i have the returned LinkUrl that is just the file. If there is no url, I need to prepend a url to the file where it will be hosted so it outputs http://mycorp.com/stores/files/store11_OKC_Docs.pdf to my view.
Any help appreciated.
0: Object
$$hashKey: "00B"
GroupId: "1"
GroupName: "Store # 11 - OKC"
LanguageName: "English"
LinkTypeAbbr: "Store_Docs"
LinkTypeDescr: "Store Documents"
LinkTypeId: "1"
LinkUrl: "store11_OKC_Docs.pdf"