(function () {
"use strict";
var app = angular.module("app1", [
// angular stuff
"ui.router",
"sharePointList",
"ui.grid",
"ngSanitize"
]);
app.config(function (SharePointListProvider, $stateProvider, $urlRouterProvider) {
// For any unmatched url, redirect to /portfolios
$urlRouterProvider.otherwise("/distributionGroups");
$stateProvider
.state('distributionGroups', {
url: '/distributionGroups',
templateUrl: 'distributiongroupstemplate.html',
controller: "SharePointListCtrl"
});
});
app.controller("SharePointListCtrl", ["$scope", "$state", "SharePointList", "$templateCache", function ($scope, $state, SharePointList, $templateCache) {
$scope.gridOptions = {
data: 'distributionGroups',
enableCellSelection: true,
enableRowSelection: false,
enableCellEdit: true,
columnDefs: [
{ field: 'Title', displayName: 'Title', enableCellEdit: false, cellClass: "w160", resizeable: true },
{ field: 'EMail', displayName: 'E-Mail', cellClass: "w160" }
]
};
var queryString = "";
SharePointList.getListItems("DistributionGroups", queryString,["Title","EMail"]).then(function (distributionGroups) {
$scope.distributionGroups = distributionGroups;
});
}]);})();
window.onload = function () {
var $rootelement = angular.element(window.document);
var modules = [
"ng",
"app1",
function ($provide) { $provide.value("$rootElement", $rootelement); }
];
var $injector = angular.injector(modules);
var $compile = $injector.get("$compile");
var compositeLinkFn = $compile($rootelement);
var $rootScope = $injector.get("$rootScope");
compositeLinkFn($rootScope);
$rootScope.$apply();
}; |