Created
November 25, 2013 03:17
-
-
Save PetersonDave/7635778 to your computer and use it in GitHub Desktop.
Angular controller calling our factory profileService to pull Sitecore items
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
(function () { | |
'use strict'; | |
// Controller name is handy for logging | |
var controllerId = 'allprofiles'; | |
// Define the controller on the module. | |
// Inject the dependencies. | |
// Point to the controller definition function. | |
angular.module('app').controller(controllerId, | |
['$scope', '$http', 'profileservice', allprofiles]); | |
function allprofiles($scope, $http, profileservice) { | |
var vm = this; | |
vm.newprofile = {}; | |
vm.profileService = profileservice; | |
vm.load = function () { | |
profileservice.get(populateRepository); | |
}; | |
function populateRepository() { | |
vm.repository = profileservice.getProfiles(); | |
} | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment