Created
March 20, 2019 18:50
Star
You must be signed in to star a gist
Angular for dads - Intro to components 2
This file contains 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
import { Component } from '@angular/core'; | |
@Component({ | |
selector: 'ng4d-greeting-card', | |
template: ` | |
<article> | |
<h1>Hello, I'm William!</h1> | |
<p>And I'm a 41 years old dad.</p> | |
</article> | |
`, | |
styles: [ | |
` | |
article { | |
width: 30%; | |
margin: 2rem auto; | |
padding: 1rem 2rem; | |
font-family: sans-serif; | |
border: 1px solid #cccccc; | |
} | |
h1 { | |
font-family: serif; | |
margin: 0 0 1rem 0; | |
} | |
p { | |
margin: 0; | |
} | |
`, | |
], | |
}) | |
export class GreetingCardComponent {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment