12345678910111213141516171819202122232425262728293031 |
- /**
- * Created by robin on 11/1/15.
- */
-
- angular.module('app')
- .controller('SideBarController', ['$scope', '$state', 'DataShareBusiness', 'GroupsBusiness',
- function($scope, $state, DataShareBusiness, GroupsBusiness) {
-
- $scope.DataShareBusiness = DataShareBusiness;
-
- $scope.getCurrentGroups = function()
- {
- if (DataShareBusiness.CurrentGroups.length != 0) {
- var e = DataShareBusiness.CurrentGroups[DataShareBusiness.CurrentGroups.length - 1];
- if (e.Groups.length == 0) {
- return e.Parent.Groups;
- }
- return e.Groups;
- }
- return DataShareBusiness.Groups;
- };
-
- var promiseLoadGroups = {
- id: "promiseLoadGroups",
- loaderGroups: ["sidebar", "toolbar"]
- };
- GroupsBusiness.loadAll(promiseLoadGroups).then(function(data)
- {
- $scope.groups = data;
- });
- }]);
|