I have a static.config file with some data that needs to be displayed within a component on a single page application. The model for the data is consistent (the same keys but different values for each object), but depending on the URL slug, the values should change to display the data relevant for the current "page".
export const data = {
setOne: {
industryId: 'set-one',
industryName: 'Set One',
firstPoint: 'lorum',
secondPoint: ' Ipsum',
thirdPoint: 'lorum',
videoContent: ['https://www.youtube.com', 'https://www.youtube.com']
},
setTwo: {
industryId: 'set-two',
industryName: 'Set two',
firstPoint: 'lorum',
secondPoint: ' Ipsum',
thirdPoint: 'lorum',
videoContent: ['https://www.youtube.com', 'https://www.youtube.com']
},
setThree: {
industryId: 'set-three',
industryName: 'Set three',
firstPoint: 'lorum',
secondPoint: ' Ipsum',
thirdPoint: 'lorum',
videoContent: ['https://www.youtube.com', 'https://www.youtube.com']
},
};
So www.site.com/set-one should display the values in setOne etc..
Is there a way to trigger the display of different values in the HTML template when the URL slug changes?
I am new to Angular and still getting to grips with a JavaScript so apologies if I have missed any important information.