<div class="card-block" [dragula]='"fifth-bag"'>
<div>en_GB</div>
<div>en_US</div>
<div>Telugu</div>
<div>HIndi</div>
</div>
我需要在语言的地方用json替换数据才有可能
答案 0 :(得分:0)
<div class="card-block draghe" [dragula]='"fifth-bag"'>
<div *ngFor="let lang of langs.test">
{{lang.name}}
</div>
</div>
ngOnInit() {
this.http.get('/assets/data/language.json')
.map(res => res.json())
.subscribe(data => this.langs = data,
err => console.log(err),
() => console.log('Completed')); }