A Pen by Joe Watkins on CodePen.
Created
February 17, 2014 19:46
-
-
Save joe-watkins/9057585 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"> | |
<div ng-repeat="employee in Employees.it"> | |
{{employee.name}} | |
</div> | |
</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: "Hugh Jackman", | |
character: "Wolverine", | |
abilities: ["strength"], | |
favorite: true | |
}, | |
{ | |
name: "Thor", | |
character: "Chris Hemsworth", | |
abilities: ["strength"], | |
favorite: false | |
} | |
]; | |
return Employees; | |
}); | |
function EmployeesCtrl($scope, Employees) { | |
$scope.Employees = Employees; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment