Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
L
luna
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
luna
Commits
1a97e0a4
Commit
1a97e0a4
authored
Aug 31, 2017
by
liuzheng712
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
3cc28373
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
69 deletions
+16
-69
app.component.html
src/app/app.component.html
+5
-17
app.component.ts
src/app/app.component.ts
+8
-28
app.module.ts
src/app/app.module.ts
+3
-3
index.component.ts
src/app/index.component.ts
+0
-16
index.html
src/app/index.html
+0
-5
No files found.
src/app/app.component.html
View file @
1a97e0a4
<h1>
{{title}}
</h1>
<app-nav></app-nav>
<h2>
My Heroes
</h2>
<app-leftbar></app-leftbar>
<ul
class=
"heroes"
>
<!--<term id="ngdiv" [ngClass]="{'hideleftbar':DataStore.leftbarhide}"></term>-->
<li
*
ngFor=
"let hero of heroes"
<router-outlet></router-outlet>
[
class
.
selected
]="
hero =
==
selectedHero
"
<app-footer></app-footer>
(
click
)="
onSelect
(
hero
)"
>
<span
class=
"badge"
>
{{hero.id}}
</span>
{{hero.name}}
</li>
</ul>
<div
*
ngIf=
"selectedHero"
>
<h2>
{{selectedHero.name}} details!
</h2>
<div><label>
id:
</label>
{{selectedHero.id}}
</div>
<div>
<label>
name:
</label>
<input
[(
ngModel
)]="
selectedHero
.
name
"
placeholder=
"name"
/>
</div>
</div>
src/app/app.component.ts
View file @
1a97e0a4
import
{
Component
}
from
'@angular/core'
;
/**
* Created by liuzheng on 2017/8/31.
export
class
Hero
{
*/
id
:
number
;
import
{
Component
}
from
'@angular/core'
;
name
:
string
;
import
{
AppService
}
from
'./app.service'
;
}
const
HEROES
:
Hero
[]
=
[
{
id
:
11
,
name
:
'Mr. Nice'
},
{
id
:
12
,
name
:
'Narco'
},
{
id
:
13
,
name
:
'Bombasto'
},
{
id
:
14
,
name
:
'Celeritas'
},
{
id
:
15
,
name
:
'Magneta'
},
{
id
:
16
,
name
:
'RubberMan'
},
{
id
:
17
,
name
:
'Dynama'
},
{
id
:
18
,
name
:
'Dr IQ'
},
{
id
:
19
,
name
:
'Magma'
},
{
id
:
20
,
name
:
'Tornado'
}
];
@
Component
({
@
Component
({
selector
:
'app-root'
,
selector
:
'app-root'
,
templateUrl
:
'./app.component.html'
,
templateUrl
:
'./app.component.html'
,
styleUrls
:
[
'./app.component.css'
]
providers
:
[
AppService
],
// directives: [LeftbarComponent, TermComponent]
})
})
export
class
AppComponent
{
export
class
AppComponent
{
title
=
'Tour of Heroes'
;
// DataStore = DataStore;
heroes
=
HEROES
;
selectedHero
:
Hero
;
onSelect
(
hero
:
Hero
):
void
{
this
.
selectedHero
=
hero
;
}
}
}
src/app/app.module.ts
View file @
1a97e0a4
...
@@ -11,7 +11,7 @@ import { HttpModule } from '@angular/http';
...
@@ -11,7 +11,7 @@ import { HttpModule } from '@angular/http';
import
{
AppRoutingModule
}
from
'./app-routing.module'
;
import
{
AppRoutingModule
}
from
'./app-routing.module'
;
import
{
IndexComponent
}
from
'./index
.component'
;
import
{
AppComponent
}
from
'./app
.component'
;
import
{
WelcomeComponent
}
from
'./welcome.component'
;
import
{
WelcomeComponent
}
from
'./welcome.component'
;
import
{
NavComponent
}
from
'./nav.component'
;
import
{
NavComponent
}
from
'./nav.component'
;
import
{
FooterComponent
}
from
'./footer.component'
;
import
{
FooterComponent
}
from
'./footer.component'
;
...
@@ -26,7 +26,7 @@ import {PageNotFoundComponent} from './not-found.component';
...
@@ -26,7 +26,7 @@ import {PageNotFoundComponent} from './not-found.component';
HttpModule
,
HttpModule
,
],
],
declarations
:
[
declarations
:
[
Index
Component
,
App
Component
,
WelcomeComponent
,
WelcomeComponent
,
NavComponent
,
NavComponent
,
LeftbarComponent
,
LeftbarComponent
,
...
@@ -35,7 +35,7 @@ import {PageNotFoundComponent} from './not-found.component';
...
@@ -35,7 +35,7 @@ import {PageNotFoundComponent} from './not-found.component';
// HeroListComponent,
// HeroListComponent,
// CrisisListComponent,
// CrisisListComponent,
],
],
bootstrap
:
[
Index
Component
],
bootstrap
:
[
App
Component
],
providers
:
[
providers
:
[
{
provide
:
Options
,
useValue
:
{
store
:
false
,
level
:
LoggerLevel
.
WARN
}},
{
provide
:
Options
,
useValue
:
{
store
:
false
,
level
:
LoggerLevel
.
WARN
}},
Logger
Logger
...
...
src/app/index.component.ts
deleted
100644 → 0
View file @
3cc28373
/**
* Created by liuzheng on 2017/8/31.
*/
import
{
Component
}
from
'@angular/core'
;
import
{
AppService
}
from
'./app.service'
;
@
Component
({
selector
:
'app-root'
,
templateUrl
:
'./index.html'
,
providers
:
[
AppService
],
// directives: [LeftbarComponent, TermComponent]
})
export
class
IndexComponent
{
// DataStore = DataStore;
}
src/app/index.html
deleted
100644 → 0
View file @
3cc28373
<app-nav></app-nav>
<app-leftbar></app-leftbar>
<!--<term id="ngdiv" [ngClass]="{'hideleftbar':DataStore.leftbarhide}"></term>-->
<router-outlet></router-outlet>
<app-footer></app-footer>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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