import { Component } from '@angular/core';
@Component({
selector : 'sandbox',
// templateUrl : `./sandbox.component.html`,
template : `
<h1>hello world</h1>
{{champion}}
<ul>
<li *ngFor="let champion of champions; let i= index">
{{i +1}} -{{champion}}
</li>
</ul>
<ul>
<li *ngFor="let champion of champions2; let i = index">
<p>챔프명 : {{champion.name}} </p>
<p>포지션 : {{champion.position}}</p>
</li>
</ul>
`,
styleUrls : [`./sandbox.component.css`]
})
export class SandboxComponent{
champions = ['리신','샤코','엘리스','그레이브스']
champions2 = [
{
name : '럼블',
position: ['top', 'jungle']
},
{
name : '티모',
position: ['top', 'trolling']
},
{
name : '야스오',
position: ['mid', 'top', 'trolling']
},
{
name : '샤코',
position: ['top', 'jungle']
},
{
name : '자이라',
position: ['support']
},
{
name : '이즈리얼',
position: ['mid', 'adcarry']
},
]
constructor(){
this.champions[2] = '캐롤';
}
}
댓글 없음:
댓글 쓰기