A Pen by Joe Watkins on CodePen.
Created
February 17, 2014 19:46
-
-
Save joe-watkins/9057584 to your computer and use it in GitHub Desktop.
A Pen by Joe Watkins.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div ng-app="myApp"> | |
<div ng-controller="EmployeeCtrl"> | |
<table> | |
<tr ng-repeat="employee in employees.itDepartment | orderBy:'name'"> | |
<td>{{employee.name}}</td> | |
<td>{{employee.position}}</td> | |
<td><span ng-repeat="skill in employee.skills">{{skill}} </span></td> | |
</tr> | |
</table> | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var myApp = angular.module('myApp',[]); | |
myApp.factory('Employees',function(){ | |
var Employees = {}; | |
Employees.itDepartment = [ | |
{ | |
name : "Joe Watkins", | |
position : "Developer", | |
skills : ["HTML","CSS","jQuery"] | |
}, | |
{ | |
name : "Sam Bartell", | |
position : "Developer", | |
skills : ["PHP"] | |
}, | |
{ | |
name : "Mark Jensen", | |
position : "Developer", | |
skills : ["Node.js"] | |
} | |
]; | |
return Employees; | |
}); | |
function EmployeeCtrl($scope,Employees){ | |
$scope.employees = Employees; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment