Advertisement
Guest User

Untitled

a guest
Mar 29th, 2015
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.21 KB | None | 0 0
  1. getContentTypeSelect: function ($scope) {
  2. entityService.getEntities('ContentType')
  3. .then(function (result) {
  4. $scope.option.contentTypes = result;
  5. $scope.option.contentTypesPlus = [{ id: 0, name: '*' }].concat(result);
  6. $scope.option.selectedContentType
  7. = localStorageService.get('selectedContentType');
  8. }, function (result) {
  9. alert("Error: No data returned");
  10. });
  11. },
  12.  
  13. <span class="label">Type {{ option.selectedContentType }}</span>
  14. <select
  15. data-ng-disabled="!option.selectedSubject"
  16. data-ng-model="option.selectedContentType"
  17. data-ng-options="item.id as item.name for item in option.contentTypesPlus">
  18. <option style="display: none" value="">Select Content Type</option>
  19. </select>
  20.  
  21. $scope.$watch('option.selectedContentType', function () {
  22. if ($scope.option.selectedContentType != null) {
  23. localStorageService.add('selectedContentType',
  24. $scope.option.selectedContentType);
  25. $scope.grid.data = null;
  26. $scope.grid.selected = false;
  27. }
  28. });
  29.  
  30. 0: Object
  31. id: 0
  32. name: "*"
  33. __proto__: Object
  34. 1: b
  35. id: 1
  36. name: "Page"
  37. __proto__: b
  38. 2: b
  39. id: 2
  40. name: "Menu"
  41. __proto__: b
  42. 3: b
  43. id: 3
  44. name: "Content Block"
  45. __proto__: b
  46.  
  47. item.id as item.name for item in option.contentTypesPlus
  48.  
  49. <select
  50. ng-model="language.selected"
  51. ng-init="language.selected = settings.language[settings.language.selected.id]"
  52. ng-options="l.label for l in settings.language"
  53. ng-change="updateLanguage(language.selected)">
  54.  
  55. $scope.settings = {
  56. enableEventsNotification: true,
  57. enableiBeaconNotification: true,
  58. hours: [
  59. { id: 0, label: '3h', value: 3 },
  60. { id: 1, label: '6h', value: 6 },
  61. { id: 2, label: '9h', value: 9 },
  62. { id: 3, label: '12h', value: 12 },
  63. { id: 4, label: '24h', value: 24 }
  64. ],
  65. language: [
  66. { id: 0, label: 'English', value: 'en-us' },
  67. { id: 1, label: 'Francais', value: 'fr-fr' }
  68. ]
  69. };
  70. $scope.hours = [];
  71. $scope.hours.selected = $localstorage.getObject('hours', $scope.settings.hours[1]);
  72. $scope.settings.hours.selected = $localstorage.getObject('hours', $scope.settings.hours[1]);
  73. $scope.hours.selected = $scope.hours.selected;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement