O
O
Oleg Morev2019-12-20 14:05:24
Angular
Oleg Morev, 2019-12-20 14:05:24

How to implement different templates in Angular builds?

Good afternoon) I have a regular web version in the project and I want to make a mobile phone in the same project, through ionic everything is fine and everything is fine, please tell me how best to implement a different representation of templates.
Let's say I have a header.component.html, and when building for a mobile phone, I took header-mobile.component.html instead

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel Shvedov, 2019-12-20
@DpOLEGapx

pass the environment variable through process.env to the code, and in the @Component() decorator, in the temaplteUrl field, substitute the desired path depending on the value of the environment variable

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question