mapping
7 years ago
angular-chosen.directive.js
7 years ago
attributes.service.js
7 years ago
autodetect.directive.js
7 years ago
cascade.directive.js
7 years ago
contenteditable.directive.js
7 years ago
currency.service.js
7 years ago
droppable.directive.js
7 years ago
export.service.js
7 years ago
focusMeWhenEnabled.directive.js
7 years ago
googleCategoriesService.js
7 years ago
main.controller.js
7 years ago
styledInput.directive.js
7 years ago
template.service.js
7 years ago
tipsy.directive.js
7 years ago
wpHttp.service.js
7 years ago
autodetect.directive.js
21 lines
| 1 | GoogleMerchants.directive('autodetect', ['attributesService', function(attributesService) { |
| 2 | return { |
| 3 | restrict: 'A', |
| 4 | require: '^ngModel', |
| 5 | link: { |
| 6 | post: function (scope, element, attributes, ngModelCtrl) { |
| 7 | |
| 8 | var autodetectValue = attributes.autodetect; |
| 9 | |
| 10 | attributes = attributesService.getAttributes(); |
| 11 | |
| 12 | angular.forEach(attributes, function (attribute) { |
| 13 | if (attribute.label.toLowerCase() == autodetectValue.toLowerCase() || attribute.name.toLowerCase() == autodetectValue.toLowerCase()) { |
| 14 | ngModelCtrl.$setViewValue('{' + attribute.name + '}'); |
| 15 | ngModelCtrl.$render(); |
| 16 | } |
| 17 | }) |
| 18 | } |
| 19 | } |
| 20 | }; |
| 21 | }]); |