Skip to content

Instantly share code, notes, and snippets.

@leosilvadev
Created February 12, 2016 00:07
Show Gist options
  • Save leosilvadev/7af3f888f21592ef53b4 to your computer and use it in GitHub Desktop.
Save leosilvadev/7af3f888f21592ef53b4 to your computer and use it in GitHub Desktop.
<img src="{{url}}" class="img-responsive img-thumbnail" alt="{{title}}">
</img>
angular.module('rh.components', [])
.directive('imgContainer', function(){
return {
restrict: 'EA',
templateUrl: 'js/components/img-container.html',
scope:{
url:'@url',
title:'@title'
}
}
});
<section>
<div class="row">
<div class="well col-sm-12">
<table class="table table-hover table-bordered">
<thead>
<tr>
<th colspan="7">
<div class="form-group">
<div class="input-group" style="width: 100%;">
<div class="input-group-addon">
<span class="glyphicon glyphicon-search"></span> Pesquisar
</div>
<input class="form-control" ng-model="searchByName">
</div>
</div>
</th>
</td>
<tr>
<th style="width:5%">Id</th>
<th style="width:35%">Name</th>
<th style="width:5%">Age</th>
<th style="width:15%">Job</th>
<th style="width:10%">Status</th>
<th style="width:10%">Salary</th>
<th style="width:20%"></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="emp in employees | filter:searchByName">
<td>{{emp.id}}</td>
<td>{{emp.name}}</td>
<td>{{emp.age}}</td>
<td>{{emp.job}}</td>
<td>{{emp.status}}</td>
<td>{{emp.salary | currency}}</td>
<td>
<img-container title="Leao" url="http://www.gannett-cdn.com/-mm-/1a6a6cd9141d907f1f3be453a82e4db3a52482c9/c=734-509-2499-1836&r=x404&c=534x401/local/-/media/2015/07/30/USATODAY/USATODAY/635738838579827895-AP-Zimbabwe-Lion-Killed-001.jpg"></img-container>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment