1

I am starting a developement of a big project and I need to know if to use ViewEncapsulation None or Emulated. From some reason the default is Emulated but I noticed that Angualr2 Material uses None.

We need to have reusable widgets within the projects and have different styles and also dynamic themes. I know it's can be done with Emulated but is seems more difficult to manage and not as simple as using CSS rules or override.

What should be the recommended mode for such a project?

1

2 Answers 2

1

The benefits of using 'Emulated' option is, that You will be able to create encapsulated components(styles, template, etc.). Also it will help You to not only create component once(dropdown, table, popup) and reuse it within your current project, but also it can be used in different projects later or being open-sourced, if You will.

Sign up to request clarification or add additional context in comments.

Comments

1

The recommended way is using the Emulated option. It will give you the ability to encapsulate your component, not only the HTML template, but also the styles.

This is the future. It is called web components and I strongly advise you to read about it. For more details, see:

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.