Last active
March 10, 2019 13:22
-
-
Save gparlakov/35720cbbb04172465c55f199d4021134 to your computer and use it in GitHub Desktop.
Two angular components using the same class name for style
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Component({ | |
| selector: "gp-button1", | |
| template: ` | |
| <p class="button"> | |
| button1 works! | |
| </p> | |
| `, | |
| styles: [".button { background-color: green; color: white}"], | |
| encapsulation: ViewEncapsulation.Emulated // the default | |
| }) | |
| export class Button1Component {} | |
| @Component({ | |
| selector: "gp-button2", | |
| template: ` | |
| <p class="button"> | |
| button2 works! | |
| </p> | |
| `, | |
| styles: [".button { background-color: cyan;}"], | |
| encapsulation: ViewEncapsulation.Emulated // the default | |
| }) | |
| export class Button2Component {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment