Skip to content

Instantly share code, notes, and snippets.

@wharley
Created February 10, 2017 18:17
Show Gist options
  • Save wharley/f460a4e0730f0d5c2201e98e38a325a4 to your computer and use it in GitHub Desktop.
Save wharley/f460a4e0730f0d5c2201e98e38a325a4 to your computer and use it in GitHub Desktop.
import { Component } from '@angular/core';
import { FunctionService } from './function.service';
@Component({
selector: 'function',
template: `
<div class="container center-block">
<div class="row col-md-6 col-md-offset-2 custyle">
<table class="table table-striped custab">
<thead>
<a href="#" class="btn btn-primary btn-xs pull-right"><b>+</b> Nova função</a>
<tr>
<th>ID</th>
<th>Descrição</th>
<th class="text-center">Ação</th>
</tr>
</thead>
<tr *ngFor="let data of datas">
<td>{{data.id_funcao_oper}}</td>
<td>{{data.descricao}}</td>
<td class="text-center"><a class='btn btn-info btn-xs' href="#"><span class="glyphicon glyphicon-edit"></span> Edit</a> <a href="#" class="btn btn-danger btn-xs"><span class="glyphicon glyphicon-remove"></span> Del</a></td>
</tr>
</table>
</div>
</div>
`,
styleUrls: ['function.component.css'],
providers: [
FunctionService
]
})
export class FunctionComponent {
datas: any;
constructor(public service: FunctionService) {
this.service.getFunctions()
.subscribe(
datas => this.datas = datas);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment