You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

sidebar.controller.js 1.0KB

12345678910111213141516171819202122232425262728293031
  1. /**
  2. * Created by robin on 11/1/15.
  3. */
  4. angular.module('app')
  5. .controller('SideBarController', ['$scope', '$state', 'DataShareBusiness', 'GroupsBusiness',
  6. function($scope, $state, DataShareBusiness, GroupsBusiness) {
  7. $scope.DataShareBusiness = DataShareBusiness;
  8. $scope.getCurrentGroups = function()
  9. {
  10. if (DataShareBusiness.CurrentGroups.length != 0) {
  11. var e = DataShareBusiness.CurrentGroups[DataShareBusiness.CurrentGroups.length - 1];
  12. if (e.Groups.length == 0) {
  13. return e.Parent.Groups;
  14. }
  15. return e.Groups;
  16. }
  17. return DataShareBusiness.Groups;
  18. };
  19. var promiseLoadGroups = {
  20. id: "promiseLoadGroups",
  21. loaderGroups: ["sidebar", "toolbar"]
  22. };
  23. GroupsBusiness.loadAll(promiseLoadGroups).then(function(data)
  24. {
  25. $scope.groups = data;
  26. });
  27. }]);