Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
envol
ENVOL 2021 TP Angular
Commits
44b8f112
Commit
44b8f112
authored
Nov 03, 2021
by
Tifenn Guillas
Browse files
Fix typo
parent
6b3b4ad4
Changes
5
Hide whitespace changes
Inline
Side-by-side
client/src/app/app.component.html
View file @
44b8f112
<nav
class=
"navbar navbar-expand-lg navbar-dark bg-dark"
>
<div
class=
"container-fluid"
>
<a
class=
"navbar-brand"
routerLink=
"home"
>
ENVOL TP Angular
</a>
<button
class=
"navbar-toggler"
type=
"button"
data-bs-toggle=
"collapse"
data-bs-target=
"#navbarSupportedContent"
aria-controls=
"navbarSupportedContent"
aria-expanded=
"false"
aria-label=
"Toggle navigation"
>
<button
class=
"navbar-toggler"
type=
"button"
data-bs-toggle=
"collapse"
data-bs-target=
"#navbarSupportedContent"
aria-controls=
"navbarSupportedContent"
aria-expanded=
"false"
aria-label=
"Toggle navigation"
>
<span
class=
"navbar-toggler-icon"
></span>
</button>
<div
class=
"collapse navbar-collapse"
id=
"navbarSupportedContent"
>
<ul
class=
"navbar-nav me-auto mb-2 mb-lg-0"
>
<li
class=
"nav-item"
>
<a
class=
"nav-link"
aria-current=
"page"
routerLink=
"home"
routerLinkActive=
"active"
><span
class=
"fas fa-home"
></span>
Home
</a>
<a
class=
"nav-link"
aria-current=
"page"
routerLink=
"home"
routerLinkActive=
"active"
>
<span
class=
"fas fa-home"
></span>
Home
</a>
</li>
<li
class=
"nav-item"
>
<a
class=
"nav-link"
routerLink=
"super-heroes"
routerLinkActive=
"active"
><span
class=
"fas fa-mask"
></span>
Super heroes
</a>
<a
class=
"nav-link"
routerLink=
"super-heroes"
routerLinkActive=
"active"
>
<span
class=
"fas fa-mask"
></span>
Super heroes
</a>
</li>
</ul>
</div>
...
...
client/src/app/app.component.spec.ts
View file @
44b8f112
...
...
@@ -19,17 +19,4 @@ describe('AppComponent', () => {
const
app
=
fixture
.
componentInstance
;
expect
(
app
).
toBeTruthy
();
});
it
(
`should have as title 'client'`
,
()
=>
{
const
fixture
=
TestBed
.
createComponent
(
AppComponent
);
const
app
=
fixture
.
componentInstance
;
expect
(
app
.
title
).
toEqual
(
'
client
'
);
});
it
(
'
should render title
'
,
()
=>
{
const
fixture
=
TestBed
.
createComponent
(
AppComponent
);
fixture
.
detectChanges
();
const
compiled
=
fixture
.
nativeElement
as
HTMLElement
;
expect
(
compiled
.
querySelector
(
'
.content span
'
)?.
textContent
).
toContain
(
'
client app is running!
'
);
});
});
client/src/app/home.component.ts
View file @
44b8f112
...
...
@@ -6,5 +6,5 @@ import { Component } from '@angular/core';
styleUrls
:
[
'
./home.component.scss
'
]
})
export
class
HomeComponent
{
title
=
'
Bienvenue dans le TP Angular ENVOL 2021
'
;
title
:
string
=
'
Bienvenue dans le TP Angular ENVOL 2021
'
;
}
client/src/app/super-heroes-list.component.html
View file @
44b8f112
...
...
@@ -7,11 +7,13 @@
<h1>
Voici une liste de super héros :
</h1>
<ul>
<li
*ngFor=
"let hero of superheroes"
[class.isImportant]=
"hero === 'Thor'"
>
<
i
*ngIf=
"hero === 'Hulk'"
class=
"fas fa-check"
></
i
>
<
span
*ngIf=
"hero === 'Hulk'"
class=
"fas fa-check"
></
span
>
{{ hero }}
</li>
</ul>
<p>
<button
class=
"btn btn-primary"
type=
"button"
[disabled]=
"newHeroAdded"
(click)=
"addNewHero.emit()"
>
Ajouter un nouveau héro
</button>
<button
class=
"btn btn-primary"
type=
"button"
[disabled]=
"newHeroAdded"
(click)=
"addNewHero.emit()"
>
Ajouter un nouveau héro
</button>
</p>
</ng-container>
client/src/app/super-heroes.component.ts
View file @
44b8f112
...
...
@@ -17,7 +17,7 @@ export class SuperHeroesComponent implements OnInit {
constructor
(
private
httpClient
:
HttpClient
)
{
}
ngOnInit
()
{
ngOnInit
()
:
void
{
this
.
superheroesIsLoading
=
true
;
this
.
httpClient
.
get
<
string
[]
>
(
'
assets/superheroes.json
'
).
pipe
(
delay
(
1000
)).
subscribe
(
data
=>
{
this
.
superheroes
=
data
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment