Skip to content

Instantly share code, notes, and snippets.

Avatar
🌏
A new opportunity ? hmmm why not

William Koza wKoza

🌏
A new opportunity ? hmmm why not
View GitHub Profile
View app.component.ts
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'app works!';
}
View app.component.ts
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
template: `
<h1>Mon premier Component</h1>
<p>en action</p>
`,
  styleUrls: ['./app.component.css']
})
View index.html
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>MonPremierProjet</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
View app.component.ts
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
template: `
<h1>Mon premier Component</h1>
<app-child></app-child>
<app-cadre>un contenu dans mon cadre</app-cadre>
`,
  styles: [`
View child.component.ts
import { Component} from '@angular/core';
@Component({
selector: 'app-child',
template: `
<h1>Mon second Component</h1>
`,
styles: [`
h1 {
color : blue;
View cadre.component.ts
import { Component } from '@angular/core';
@Component({
selector: 'app-cadre',
template: `
<div class="bordure">
<h1>
<ng-content></ng-content>
</h1>
</div>
View app.component.ts
import {Component} from '@angular/core';
@Component({
selector: 'app-root',
template: `
<h1>Mon premier Component</h1>
<app-child></app-child>
`,
styles: [`
h1 {
View app.component.ts
import {Component, ViewEncapsulation} from '@angular/core';
@Component({
selector: 'app-root',
template: `
<h1>Mon premier Component</h1>
<app-child></app-child>
`,
styles: [`
h1 {
View app.component.ts
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
template: `
Personne : {{person}} | Age : {{age}} | Adresse : {{address}}
`
})
export class AppComponent {
View app.component.ts
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
template: `
<div>Personne : {{person}} | Age : {{age}} | Adresse : {{address}}</div>
`
})
export class AppComponent {