Guest User

Untitled

a guest
Feb 21st, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.97 KB | None | 0 0
  1. <md-input-container flex class="md-icon-float md-block no-margin-bottom md-select-align">
  2. <label id="symptomCodeslbl" for="symptomCodeslbl">Failure Codes</label>
  3. <md-icon class="pad-left10" md-font-icon="fa fa-gavel"></md-icon>
  4. <md-select id="symptomCodesDropDownList" name="SymptomCode" ng-model="sparePartDetails.SymptomCode" multiple>
  5. <md-optgroup label="{{code}}" ng-repeat="code in failureCodeList">
  6. <md-option ng-value="symptom" ng-selected="selectFailureCode(symptom.Description)" ng-repeat="symptom in symptoms | filter:{FailureCode:code}">{{symptom.Description}}</md-option>
  7. </md-optgroup>
  8. </md-select>
  9. </md-input-container>
  10.  
  11. $scope.selectFailureCode = function (description) {
  12. angular.forEach(partDetails.FailureCode, function (value, key) {
  13. if (description == value.Description) {
  14. return true;
  15. }
  16. else {
  17. return false;
  18. }
  19. });
  20. }
  21.  
  22. [{ "IDFailureCode": "51d01fdf-1d3f-4c7e-97bb-27a713b91c03", "Description": "11 - Keyboard Backlight", "IDParentFailureCode": "842cce3d-c26c-487d-9b69-09d06ad6d7b5", "FailureCode": "CN - Connector not working" }, { "IDFailureCode": "05ae9dd7-06c2-4080-92ac-71f1e0c81230", "Description": "01 - OTHER STORAGE DEVICE NOT RECOGNIZED", "IDParentFailureCode": "7f494365-0801-412a-9512-0a3f3b5f2911", "FailureCode": "SD - OTHER STORAGE DEVICE" }]
  23.  
  24. "ChildFailureDetail": [
  25. {
  26. "IDFailureCode": "a7b6cd59-5f7e-4b83-8f54-3c908e0484ed",
  27. "Description": "02 - OTHER STORAGE DEVICE FUNCTION FAILURE",
  28. "IDParentFailureCode": "7f494365-0801-412a-9512-0a3f3b5f2911",
  29. "FailureCode": "SD - OTHER STORAGE DEVICE"
  30. },
  31. {
  32. "IDFailureCode": "05ae9dd7-06c2-4080-92ac-71f1e0c81230",
  33. "Description": "01 - OTHER STORAGE DEVICE NOT RECOGNIZED",
  34. "IDParentFailureCode": "7f494365-0801-412a-9512-0a3f3b5f2911",
  35. "FailureCode": "SD - OTHER STORAGE DEVICE"
  36. },
  37. {
  38. "IDFailureCode": "9193dc86-419d-4ddf-a15a-c75727b78806",
  39. "Description": "08 - MEMORY CARD READER FUNCTION FAILURE",
  40. "IDParentFailureCode": "7f494365-0801-412a-9512-0a3f3b5f2911",
  41. "FailureCode": "SD - OTHER STORAGE DEVICE"
  42. },
  43. {
  44. "IDFailureCode": "71739865-9af6-4ca0-bfaa-cd02b27f3c66",
  45. "Description": "05 - TAPE DRIVE FUNCTION FAILURE",
  46. "IDParentFailureCode": "7f494365-0801-412a-9512-0a3f3b5f2911",
  47. "FailureCode": "SD - OTHER STORAGE DEVICE"
  48. }
  49. ]
  50.  
  51. $scope.selectedFailureCode = partDetails.FailureCode[0].Description
Add Comment
Please, Sign In to add comment