I have a service call to backend (server side) code which returns the content. I need to send the list of content id to server and server returns back all the content. Then I display those content on view (html page) as follows.
call service with following list of content id
contents :[
'SEARCH', 'HELP'
]
Then server returns
contents: {
'SEARCH' : 'Search Text',
'HELP' : 'Help Text',
}
Now I use those contents in angular view as
{{contents.SEARCH}}
So it prints this content. But for those code to run I need to send all the content id before view is rendered. For the complete application it will be huge.
As salutation I want to call the backend while a view is being rendered with an undefined content, but it will show the view with that key. After getting the server response that key will be converted with server response content text.
Can anyone please help.
Thanks for reply. We can solve this issue by $http interceptor. While loading the templates it will check the contents wchich are required. Then also call another http request and upon resolve it will return the original template.