Skip to content

Instantly share code, notes, and snippets.

@gparlakov
Last active March 10, 2019 13:22
Show Gist options
  • Select an option

  • Save gparlakov/35720cbbb04172465c55f199d4021134 to your computer and use it in GitHub Desktop.

Select an option

Save gparlakov/35720cbbb04172465c55f199d4021134 to your computer and use it in GitHub Desktop.
Two angular components using the same class name for style
@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