Skip to content

Instantly share code, notes, and snippets.

@PetersonDave
Created November 25, 2013 03:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PetersonDave/7635778 to your computer and use it in GitHub Desktop.
Save PetersonDave/7635778 to your computer and use it in GitHub Desktop.
Angular controller calling our factory profileService to pull Sitecore items
(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