angularjs_2_essential_training:styling_a_component
This is an old revision of the document!
// inline template
@Component ({
selector: 'media-tracker-app',
template: '<h1>My app</h1>',
})
// ou
template: `
<h1>My App</h1>
<p>now width multiline HTML</p>
`,
Ou mettre dans du html séparé :
@Component ({
selector: 'media-tracker-app',
template: 'app/app.component.html',
})
// app/app.component.html <h1>My App</h1>
Ajout de CSS
@Component ({
selector: 'media-tracker-app',
template: 'app/app.component.html',
styles: [`
h1 {
color: blue;
}
`,[`
p {
color: black;
}
`],
})
Pour le mettre ailleurs :
@Component ({
selector: 'media-tracker-app',
template: 'app/app.component.html',
styles: ['app/app.component.css'],
})
note: angular se charge de modifier les sélecteurs CSS pour cibler les éléments de l'application.
angularjs_2_essential_training/styling_a_component.1465836859.txt.gz · Last modified: 2016/06/13 18:54 by leo